From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id CC02F3857C62 for ; Sun, 6 Jun 2021 14:52:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC02F3857C62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-pj1-x102c.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso5385127pjb.4 for ; Sun, 06 Jun 2021 07:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=av8pw8UPBzVZDn3Ku8qvLOCLOVTSlb44dI8vm4VJzJI=; b=ZLA1vpucClNn6m1Yn8T/yKYySBptsnVZtNV0bEuz15BoL6B/nVKZjxzJNn38h3uNp3 JELlQDDBmZCtiaFWnQ6csE7yz8JQr4EIjiJNSdwuiIwx537pqi/0FdBqDzwS5kBa1ly0 +ALaSjK/SJ9BMsrhXXMpluXSFIXqqi9op7Yetz8gW0Liw0x6Dn0lAOeZT+TIZoT108Ph rz4SCyHGVc050zUqqj5sZYFbq5yGcLAF+Zmhh6hwHj91QHjTW0qFvsmlGDBq6v1Al2J0 umlwRMg9PSMz7ndskWSl5JMIeonyZR7gSjp4B2+3XT+CWLfMo9MV6GuQ6tPa+hmQKCs1 FY3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=av8pw8UPBzVZDn3Ku8qvLOCLOVTSlb44dI8vm4VJzJI=; b=p15oiH8JLTJM/j7IcLuvqxk16xywsiBHJ2RRo70phrcCqXg+IxBwEyyXcZ4xNGo7ke lipxvpiCKAflT3YgNvAG73E4XGW3bqdKcD0oPPODoulOmIxwFeX3hY8ZEBzW7DsiaVSs xlqTJAzDl3MOsm0yV1rlG0T0wTi/aYY9VHMUDDQQ3Tkqcck/yVSlWTZXXjszxuMStCEm obGaAmyXxyqDIc/T5xgsF0pWGEUSUF0vMDNf1941c1eoY0v1bzFUFrSSDgdA8MwriNms 7AqGE1g8n9zgH8ZuDEU9BL1N9g9gsF/ainx1ibyo1e9TpBtnyJD6W52wQG4xXoJDbq8L PBEw== X-Gm-Message-State: AOAM532TpTqKY07Xt6bUFovJ+PQYTEslUselsOdYKnzGh0w879MU83d6 c1RJfqJLwOWJk39dXEbf3EqD6HSGXdmr X-Google-Smtp-Source: ABdhPJyudpYiTWvT39WNCmmohv3DR4xENGn2T7iuWSeE1gcLBvNTjRPSwKRjPODLPFFY1iklEuZFsQ== X-Received: by 2002:a17:90a:4b8d:: with SMTP id i13mr28410602pjh.34.1622991146797; Sun, 06 Jun 2021 07:52:26 -0700 (PDT) Received: from takamaka.home ([184.69.131.86]) by smtp.gmail.com with ESMTPSA id fy16sm9517384pjb.49.2021.06.06.07.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 07:52:26 -0700 (PDT) Received: by takamaka.home (Postfix, from userid 1000) id 616D989D01; Sun, 6 Jun 2021 07:52:25 -0700 (PDT) Date: Sun, 6 Jun 2021 07:52:25 -0700 From: Joel Brobecker To: Simon Marchi via Gdb-patches Cc: Joel Brobecker Subject: Re: [PATCH] gdb: set only inferior_ptid in sparc_{fetch, store}_inferior_registers Message-ID: <20210606145225.GA576970@adacore.com> References: <20210531011648.3727731-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210531011648.3727731-1-simon.marchi@polymtl.ca> X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 14:52:29 -0000 Hi Simon, > gdb/ChangeLog: > > PR gdb/27899 > * sparc-nat.c (sparc_fetch_inferior_registers): Set > inferior_ptid instead of using switch_to_thread. > (sparc_store_inferior_registers): Likewise. Thanks for the patch. This looks good to me. Were you able to run the testsuite on the patch? If not, I could probably run it against AdaCore's testsuite on a LEON3 baremetal target -- not as good as the full official testsuite on a SPARC/Linux machine, but better than nothing... Thanks! > > Change-Id: I0b6ddb3af9b11f67b10ee46a734fb82ecc6462d5 > --- > gdb/sparc-nat.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c > index fa3b32cee184..7f09a60420db 100644 > --- a/gdb/sparc-nat.c > +++ b/gdb/sparc-nat.c > @@ -170,9 +170,8 @@ sparc_fetch_inferior_registers (process_stratum_target *proc_target, > > /* Deep down, sparc_supply_rwindow reads memory, so needs the global > thread context to be set. */ > - thread_info *thread = find_thread_ptid (proc_target, ptid); > - scoped_restore_current_thread restore_thread; > - switch_to_thread (thread); > + scoped_restore restore_inferior_ptid > + = make_scoped_restore (&inferior_ptid, ptid); > > sparc_supply_gregset (sparc_gregmap, regcache, -1, ®s); > if (regnum != -1) > @@ -219,9 +218,8 @@ sparc_store_inferior_registers (process_stratum_target *proc_target, > > /* Deep down, sparc_collect_rwindow writes memory, so needs the global > thread context to be set. */ > - thread_info *thread = find_thread_ptid (proc_target, ptid); > - scoped_restore_current_thread restore_thread; > - switch_to_thread (thread); > + scoped_restore restore_inferior_ptid > + = make_scoped_restore (&inferior_ptid, ptid); > > sparc_collect_rwindow (regcache, sp, regnum); > } > -- > 2.31.1 > -- Joel