From 1ee1a363454d88a87ad2ade7530b2a7fb670021e Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 18 Jun 2020 21:28:33 +0100 Subject: [PATCH] Don't write to inferior_ptid in go32-nat.c gdb/ChangeLog: 2020-06-18 Pedro Alves * go32-nat.c (go32_nat_target::create_inferior): Switch to thread after creating it, instead of writing to inferior_ptid. Don't write to inferior_ptid. --- gdb/ChangeLog | 6 ++++++ gdb/go32-nat.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dc15d2df4d9..bc8c37144f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-06-18 Pedro Alves + + * go32-nat.c (go32_nat_target::create_inferior): Switch to thread + after creating it, instead of writing to inferior_ptid. Don't + write to inferior_ptid. + 2020-06-18 Pedro Alves * fork-child.c (postfork_hook): Don't write to inferior_ptid. diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index d1e508cc780..8ffd28985ab 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -753,14 +753,14 @@ go32_nat_target::create_inferior (const char *exec_file, save_npx (); #endif - inferior_ptid = ptid_t (SOME_PID); inf = current_inferior (); inferior_appeared (inf, SOME_PID); if (!target_is_pushed (this)) push_target (this); - add_thread_silent (inferior_ptid); + thread_info *thr = add_thread_silent (ptid_t (SOME_PID)); + switch_to_thread (thr); clear_proceed_status (0); insert_breakpoints (); -- 2.30.2