From: Pedro Alves Date: Thu, 18 Jun 2020 20:28:33 +0000 (+0100) Subject: Don't write to inferior_ptid in go32-nat.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ee1a363454d88a87ad2ade7530b2a7fb670021e;p=binutils-gdb.git 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. --- 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 ();