aboutsummaryrefslogtreecommitdiff
path: root/gdb/bsd-kvm.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-06-18 21:28:32 +0100
committerPedro Alves <palves@redhat.com>2020-06-18 23:14:40 +0100
commit5d971d48b922afc1cfe3ba1798477473cfbd052e (patch)
tree2a304b032c95d48335bd18918fa2cd21669d066d /gdb/bsd-kvm.c
parent86e57d1b233e15f7d72b39dbd381a7e5a9d1b026 (diff)
downloadgdb-5d971d48b922afc1cfe3ba1798477473cfbd052e.zip
gdb-5d971d48b922afc1cfe3ba1798477473cfbd052e.tar.gz
gdb-5d971d48b922afc1cfe3ba1798477473cfbd052e.tar.bz2
Don't write to inferior_ptid in bsd-kvm.c
gdb/ChangeLog: 2020-06-18 Pedro Alves <palves@redhat.com> * bsd-kvm.c (bsd_kvm_target_open): Switch to thread after adding it, instead of writing to inferior_ptid.
Diffstat (limited to 'gdb/bsd-kvm.c')
-rw-r--r--gdb/bsd-kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index f35c85a..d40bfe6 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);