From 5d971d48b922afc1cfe3ba1798477473cfbd052e Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 18 Jun 2020 21:28:32 +0100 Subject: [PATCH] Don't write to inferior_ptid in bsd-kvm.c gdb/ChangeLog: 2020-06-18 Pedro Alves * bsd-kvm.c (bsd_kvm_target_open): Switch to thread after adding it, instead of writing to inferior_ptid. --- gdb/ChangeLog | 5 +++++ gdb/bsd-kvm.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2f3c1e58874..606ac65d9ce 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-06-18 Pedro Alves + + * bsd-kvm.c (bsd_kvm_target_open): Switch to thread after adding + it, instead of writing to inferior_ptid. + 2020-06-18 Pedro Alves * btrace.c (btrace_fetch): Use switch_to_thread instead of writing diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index f35c85a2ea8..d40bfe66e4c 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -136,8 +136,8 @@ bsd_kvm_target_open (const char *arg, int from_tty) core_kd = temp_kd; push_target (&bsd_kvm_ops); - add_thread_silent (&bsd_kvm_ops, bsd_kvm_ptid); - inferior_ptid = bsd_kvm_ptid; + thread_info *thr = add_thread_silent (&bsd_kvm_ops, bsd_kvm_ptid); + switch_to_thread (thr); target_fetch_registers (get_current_regcache (), -1); -- 2.30.2