In commit
98882a26513e25b2161b41dfd4bed97b59b2c01a, STARTUP_WITH_SHELL was made
a runtime toggle, startup-with-shell. The Hurd code was missed to be adjusted;
it had a value hard-coded instead of using START_INFERIOR_TRAPS_EXPECTED. Fix
that, and also simplify gnu-nat's pending_execs handling from counting to just
a flag.
gdb/
* gnu-nat.c (struct inf): Change pending_execs member to a 1-bit
flag. Adjust all users; in particular...
(gnu_wait): ..., don't decrement its value in here...
(gnu_create_inferior): ..., and instead set the flag in here,
around the startup_inferior call, and call that one with
START_INFERIOR_TRAPS_EXPECTED.
2014-02-16 Thomas Schwinge <thomas@codesourcery.com>
2014-02-16 Thomas Schwinge <thomas@codesourcery.com>
+ * gnu-nat.c (struct inf): Change pending_execs member to a 1-bit
+ flag. Adjust all users; in particular...
+ (gnu_wait): ..., don't decrement its value in here...
+ (gnu_create_inferior): ..., and instead set the flag in here,
+ around the startup_inferior call, and call that one with
+ START_INFERIOR_TRAPS_EXPECTED.
+
* gnu-nat.c (ill_rpc): Remove function; replaced with this...
(ILL_RPC): ... new macro.
(do_mach_notify_no_senders, do_mach_notify_port_deleted)
* gnu-nat.c (ill_rpc): Remove function; replaced with this...
(ILL_RPC): ... new macro.
(do_mach_notify_no_senders, do_mach_notify_port_deleted)
unsigned int no_wait:1;
/* When starting a new inferior, we don't try to validate threads until all
unsigned int no_wait:1;
/* When starting a new inferior, we don't try to validate threads until all
- the proper execs have been done. This is a count of how many execs we
+ the proper execs have been done, which this flag states we still
- unsigned pending_execs;
+ unsigned int pending_execs:1;
/* Fields describing global state. */
/* Fields describing global state. */
while execing. */
{
w->suppress = 1;
while execing. */
{
w->suppress = 1;
- inf_debug (inf, "pending_execs = %d, ignoring minor event",
- inf->pending_execs);
+ inf_debug (inf, "pending_execs, ignoring minor event");
}
else if (kind == TARGET_WAITKIND_STOPPED
&& w->status.value.sig == GDB_SIGNAL_TRAP)
/* Ah hah! A SIGTRAP from the inferior while starting up probably
means we've succesfully completed an exec! */
{
}
else if (kind == TARGET_WAITKIND_STOPPED
&& w->status.value.sig == GDB_SIGNAL_TRAP)
/* Ah hah! A SIGTRAP from the inferior while starting up probably
means we've succesfully completed an exec! */
{
- if (--inf->pending_execs == 0)
- /* We're done! */
- {
-#if 0 /* do we need this? */
- prune_threads (1); /* Get rid of the old shell
- threads. */
- renumber_threads (0); /* Give our threads reasonable
- names. */
-#endif
- }
- inf_debug (inf, "pending exec completed, pending_execs => %d",
- inf->pending_execs);
+ inf_debug (inf, "one pending exec completed");
}
else if (kind == TARGET_WAITKIND_STOPPED)
/* It's possible that this signal is because of a crashed process
}
else if (kind == TARGET_WAITKIND_STOPPED)
/* It's possible that this signal is because of a crashed process
- inf->pending_execs = 2;
+ inf->pending_execs = 1;
inf->nomsg = 1;
inf->traced = 1;
inf->nomsg = 1;
inf->traced = 1;
thread_change_ptid (inferior_ptid,
ptid_build (inf->pid, inf_pick_first_thread (), 0));
thread_change_ptid (inferior_ptid,
ptid_build (inf->pid, inf_pick_first_thread (), 0));
- startup_inferior (inf->pending_execs);
+ startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
+ inf->pending_execs = 0;
inf_validate_procinfo (inf);
inf_update_signal_thread (inf);
inf_validate_procinfo (inf);
inf_update_signal_thread (inf);