Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4297599rwb; Sun, 13 Nov 2022 03:17:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sDyInonYzwtXUdyUbeOF+Vdu0WSaRyfe4YDBXTXLGJVEPLUFtAFa5SiqGXwUAETm1kOSH X-Received: by 2002:a05:6402:748:b0:461:9955:b54a with SMTP id p8-20020a056402074800b004619955b54amr7775999edy.159.1668338238193; Sun, 13 Nov 2022 03:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668338238; cv=none; d=google.com; s=arc-20160816; b=Tr08P62tvxoz+OGivgMDH4Y6IRH6/qT93Gg8yApbug0AIHm4qpKC7NqB0BfWt3Q3wa HfhmUZqYeh5a83aT3wLFJG5uk9cr5QO2Uo1Ep/lOGsKVVy8c1ZWemJnY5e59QDeG4pV4 4R6yoTOfSY/RQjDOeqxyCxnpyyL0odBcsADi6ND+yY2wWEHVq2S4duvswhVNsx6MdjMr T1JdxJmv6DBNYh/+NhCSOgBe3PKi4CIkGduIvh2Zr0WkES8LK7dUMcT49Yy7KpnnQbxt raBxoqqj1qtvkOCy0rY8iBp56gCWi6fKBGxxL8qJ3/mcI1ylWX0HgvbOFZOVJgihFX76 jOew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1lNkqm5mDHS7GJ3dOEBMgWRtlQ/aBzzuCqiGbGOTN6Q=; b=AmkxGA2hE0QUTYbS5wvEukQBoGcrwvy59ZLQQMGigql7OKt0LVsSBH/rEWnKyY4816 09xNJ+rIlttncBCEUz1OAx7dl1f8m6msGWykqOAhpp4NbTUWJUUkcaU30Teq+59OR5vO T5iAyp9iwG+rHeK2T+JGT0a/NKeOcE/9oJSoHoVy6oGlTlVbiWKQ+1hbPjRxq5TLqI55 22jA55HsUwm0Hgg5IXZoIV3Pz2C76am7doNyFhcL7J2Z2+5Swyj8+E0mzq/WJ9vo6XpH dJHL7n/r6gpAiBEXocZCJFZ+inJo77GcB0KWz5Rhn5hmTbPjv70HNnBPjwXRsZym2lJL tfPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=WPijW6+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go10-20020a1709070d8a00b007ae4ed41508si6539103ejc.738.2022.11.13.03.16.56; Sun, 13 Nov 2022 03:17:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=WPijW6+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235014AbiKMLGi (ORCPT + 89 others); Sun, 13 Nov 2022 06:06:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbiKMLGg (ORCPT ); Sun, 13 Nov 2022 06:06:36 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A09B312AEE for ; Sun, 13 Nov 2022 03:06:33 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id y14so22005020ejd.9 for ; Sun, 13 Nov 2022 03:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1lNkqm5mDHS7GJ3dOEBMgWRtlQ/aBzzuCqiGbGOTN6Q=; b=WPijW6+w6bFv/6BfRE0a83Vyo18qlPKeHQ+gPFQw7RGsmomc5387pgA6QvZkfWLC+V HTFYCNOtld/x2icd7maxkdWbIwkObecoC4Eznr/FpZszHyiGoFxEP6czsMQmg1FLl8C4 2b0u8ADg+nGk9jJoWDpC+vmr/EggRCAFUWpOXkpjJErM3tlaySKmMge30ldVKPMDF9oh A9DxwMi7aGWKVHMFXfLSmND7Y+OL8KDYxB5ITinq16qXgnrei4vFmuIfAksSAfMM3exp cOmDbh3zKAR9rLgUKg7S9/lTQL5hRiA+Amiy2vCohxLgQLJ7x3KP3VZ2xcB2kYwzs7oT TS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1lNkqm5mDHS7GJ3dOEBMgWRtlQ/aBzzuCqiGbGOTN6Q=; b=bsVXyaqISWS5Ev6mKD/kDn8+VQU1WVvBOBDwHeFxdN9G8RMvROgM651WoFiL0sFKjf k9aMvVOLcDWqzqMGZTsrg8uqCxCVeeWCXPiNWKG8rgwtMqdyipt6/AxViPbeUFZiQYar 5CwDiBtqCfRo9tCB4RWx0tMYGh/w5n/9rqJ0bHYDlG4lIzJfUyN1ngxXuwXr4NUmIG75 asJMooTEmtxW7EPgzXYpeADCZHZl/uyg8gOyxaIVHWvUi22rSxU2ouAEY64TsFvhVqJT s2RNnLd+pMeXZvBIKIp0gfaLGQl4j/L8xovAuA202UocYfppz3d/ZXVxQHEFJN7hmn1B 14Og== X-Gm-Message-State: ANoB5pmA92kulVeaHz/ABF+58Yh7U7jfQF28o5tDnrBKqcYEB5HR8S4L JvuvmJ/UXr84r0vKB2c4o2wszA== X-Received: by 2002:a17:906:b6d3:b0:7ae:4236:bfb5 with SMTP id ec19-20020a170906b6d300b007ae4236bfb5mr6931827ejb.428.1668337592188; Sun, 13 Nov 2022 03:06:32 -0800 (PST) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id ky14-20020a170907778e00b00782539a02absm2840462ejc.194.2022.11.13.03.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 03:06:31 -0800 (PST) Date: Sun, 13 Nov 2022 12:06:30 +0100 From: Andrew Jones To: debug@rivosinc.com Cc: palmer@dabbelt.com, jan.kiszka@siemens.com, kbingham@kernel.org, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux@rivosinc.com Subject: Re: [PATCH] gdb-script: updated lx_current for riscv Message-ID: <20221113110630.y4uppv7d4ocm3lej@kamzik> References: <20221111195938.1499148-1-debug@rivosinc.com> <20221111195938.1499148-2-debug@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111195938.1499148-2-debug@rivosinc.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2022 at 11:59:38AM -0800, debug@rivosinc.com wrote: > From: Deepak Gupta > > lx_current python gdb command defined in scripts/gdb/cpus.py updated > to support riscv architecture. > > Signed-off-by: Deepak Gupta > --- > scripts/gdb/linux/cpus.py | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py > index 15fc4626d236..ce6703f1e35a 100644 > --- a/scripts/gdb/linux/cpus.py > +++ b/scripts/gdb/linux/cpus.py > @@ -173,6 +173,14 @@ def get_current_task(cpu): > else: > raise gdb.GdbError("Sorry, obtaining the current task is not allowed " > "while running in userspace(EL0)") > + elif utils.is_target_arch("riscv"): > + current_task_addr = gdb.parse_and_eval("$tp") > + if((current_task_addr.cast(utils.get_long_type()) >> 63) != 0): Shouldn't there be a get_long_type().sizeof == 8 check somewhere before shifting by 63? Or are 32-bit targets not supported at all for some reason? Thanks, drew > + current_task = current_task_addr.cast(task_ptr_type) > + return current_task.dereference() > + else: > + raise gdb.GdbError("Sorry, obtaining the current task is not allowed " > + "while running in userspace") > else: > raise gdb.GdbError("Sorry, obtaining the current task is not yet " > "supported with this arch") > -- > 2.25.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv