+2020-06-18 Pedro Alves <palves@redhat.com>
+
+ * remote-sim.c (gdbsim_target::create_inferior): Switch to thread
+ after creating it, instead of writing to inferior_ptid.
+ (gdbsim_target_open): Use switch_to_no_thread instead of writing
+ to inferior_ptid directly.
+ (gdbsim_target::wait): Don't write to inferior_ptid.
+
2020-06-18 Pedro Alves <palves@redhat.com>
* remote.c (remote_target::remote_notice_new_inferior): Use
!= SIM_RC_OK)
error (_("Unable to create sim inferior."));
- inferior_ptid = sim_data->remote_sim_ptid;
- inferior_appeared (current_inferior (), inferior_ptid.pid ());
- add_thread_silent (this, inferior_ptid);
+ inferior_appeared (current_inferior (),
+ sim_data->remote_sim_ptid.pid ());
+ thread_info *thr = add_thread_silent (this, sim_data->remote_sim_ptid);
+ switch_to_thread (thr);
insert_breakpoints (); /* Needed to get correct instruction
in cache. */
/* There's nothing running after "target sim" or "load"; not until
"run". */
- inferior_ptid = null_ptid;
+ switch_to_no_thread ();
gdbsim_is_open = 1;
}
if (sim_data == NULL)
error (_("Unable to wait for pid %d. Inferior not found."),
ptid.pid ());
- inferior_ptid = ptid;
}
if (remote_debug)