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

Pedro Alves
2020-04-14T17:54:39Z

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(-)

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);

--
2.14.5