1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
Description: Fix FTBFS on Hurd.
Adjust to startup-with-shell changes.
Author: Thomas Schwinge <thomas@codesourcery.com>
Origin: upstream, https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=c82f56d9d760a9b4034eeaac44f2f0fa5779ff69
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index a3ed0e0..b66a7f0 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -210,9 +210,9 @@ struct inf
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
expect to happen. */
- unsigned pending_execs;
+ unsigned int pending_execs:1;
/* Fields describing global state. */
@@ -1568,26 +1568,14 @@ rewait:
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! */
{
- 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
@@ -2146,7 +2134,7 @@ gnu_create_inferior (struct target_ops *ops,
push_target (ops);
- inf->pending_execs = 2;
+ inf->pending_execs = 1;
inf->nomsg = 1;
inf->traced = 1;
@@ -2158,7 +2146,8 @@ gnu_create_inferior (struct target_ops *ops,
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);
|