[22/28] Don't write to inferior_ptid in go32-nat.c

Message ID 20200414175434.8047-23-palves@redhat.com
State New
Headers show
Series
  • Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR/25412)
Related show

Commit Message

Rogerio Alves via Gdb-patches April 14, 2020, 5:54 p.m.
gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

	* 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/go32-nat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.14.5

Patch

diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 8423001ff6..003a9d5b5b 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 ();