]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Hurd: Adjust to startup-with-shell changes.
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 8 Jan 2014 20:42:07 +0000 (21:42 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Sun, 16 Feb 2014 07:30:09 +0000 (08:30 +0100)
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.

gdb/ChangeLog
gdb/gnu-nat.c

index 2cf8a1554a0ce1eb009cce55cfa7f96468f47a19..88e0e9e78618ee0e623a7ec4be5890e7f6bc8a39 100644 (file)
@@ -1,5 +1,12 @@
 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)
index a3ed0e07a6d9bb951263ebc0c8498567f79c1502..b66a7f09aaa99891343dd872a9abe49ac28a4db3 100644 (file)
@@ -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);