+2015-08-25 Don Breazeal <donb@codesourcery.com>
+
+ * infrun.c (follow_exec): Re-order operations for
+ handling follow-exec-mode "new".
+ (handle_inferior_event_1): Assign ecs->event_thread
+ to the current thread.
+ * remote.c (get_remote_arch_state): Add an assertion.
+
2015-08-26 Pedro Alves <palves@redhat.com>
* MAINTAINERS: Add Markus Metzger as btrace maintainer.
/* The user wants to keep the old inferior and program spaces
around. Create a new fresh one, and switch to it. */
- inf = add_inferior (current_inferior ()->pid);
+ /* Do exit processing for the original inferior before adding
+ the new inferior so we don't have two active inferiors with
+ the same ptid, which can confuse find_inferior_ptid. */
+ exit_inferior_num_silent (current_inferior ()->num);
+
+ inf = add_inferior (pid);
pspace = add_program_space (maybe_new_address_space ());
inf->pspace = pspace;
inf->aspace = pspace->aspace;
-
- exit_inferior_num_silent (current_inferior ()->num);
+ add_thread (ptid);
set_current_inferior (inf);
set_current_program_space (pspace);
stop. */
follow_exec (inferior_ptid, ecs->ws.value.execd_pathname);
+ /* In follow_exec we may have deleted the original thread and
+ created a new one. Make sure that the event thread is the
+ execd thread for that case (this is a nop otherwise). */
+ ecs->event_thread = inferior_thread ();
+
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_regcache_aspace (get_current_regcache ()),
stop_pc, ecs->ptid, &ecs->ws);
static struct remote_arch_state *
get_remote_arch_state (void)
{
+ gdb_assert (target_gdbarch () != NULL);
return gdbarch_data (target_gdbarch (), remote_gdbarch_data_handle);
}