From 41792d688a5a1f158d6e9ecda2b603ae122d69a1 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 18 Jun 2020 21:28:17 +0100 Subject: [PATCH] Don't write to inferior_ptid in linux_get_siginfo_data gdb/ChangeLog: 2020-06-18 Pedro Alves * linux-tdep.c (btrace_fetch): Save/restore current thread instead of saving/restoring inferior_ptid. --- gdb/ChangeLog | 5 +++++ gdb/linux-tdep.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index da4be157cda..5611c42049c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-06-18 Pedro Alves + + * linux-tdep.c (btrace_fetch): Save/restore current thread instead + of saving/restoring inferior_ptid. + 2020-06-17 Tom Tromey * tui/tui-win.h (tui_scroll_forward, tui_scroll_backward) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 2dcdc630769..d51d953ee20 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1612,8 +1612,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.30.2