From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F294A3844036; Sun, 23 May 2021 13:09:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F294A3844036 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/27899] [GNU/Linux, sparc64] GDB crashes when debugging multithreaded programs Date: Sun, 23 May 2021 13:09:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 13:09:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27899 --- Comment #3 from Simon Marchi --- Here's a patch, can you give it a try? >>From 5ba17db11ad88ae2a26183f8dd5c558b696d1c3e Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 23 May 2021 07:48:34 -0400 Subject: [PATCH] fix 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 =3D find_thread_ptid (proc_target, ptid); - scoped_restore_current_thread restore_thread; - switch_to_thread (thread); + scoped_restore restore_inferior_ptid + =3D make_scoped_restore (&inferior_ptid, ptid); sparc_supply_gregset (sparc_gregmap, regcache, -1, ®s); if (regnum !=3D -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 =3D find_thread_ptid (proc_target, ptid); - scoped_restore_current_thread restore_thread; - switch_to_thread (thread); + scoped_restore restore_inferior_ptid + =3D make_scoped_restore (&inferior_ptid, ptid); sparc_collect_rwindow (regcache, sp, regnum); } --=20 2.31.1 --=20 You are receiving this mail because: You are on the CC list for the bug.=