[01/28] Don't write to inferior_ptid in linux_get_siginfo_data

Message ID 20200414175434.8047-2-palves@redhat.com
State New
Headers show
Series
  • Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR/25412)
Related show

Commit Message

Rogerio Alves via Gdb-patches April 14, 2020, 5:54 p.m.
gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

	* linux-tdep.c (btrace_fetch): Save/restore current thread instead
	of saving/restoring inferior_ptid.
---
 gdb/linux-tdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.14.5

Patch

diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index e50946ce37..f204831e39 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1618,8 +1618,8 @@  linux_get_siginfo_data (thread_info *thread, struct gdbarch *gdbarch)
   if (!gdbarch_get_siginfo_type_p (gdbarch))
     return gdb::byte_vector ();
 
-  scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
-  inferior_ptid = thread->ptid;
+  scoped_restore_current_thread save_current_thread;
+  switch_to_thread (thread);
 
   siginfo_type = gdbarch_get_siginfo_type (gdbarch);