diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-07-27 18:44:40 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-07-27 18:44:40 +0000 |
commit | c588c53caf5aad8ebbee231437d2146359392725 (patch) | |
tree | ebd58319764ea664f70bef4cf93bf7a373683507 /gdb | |
parent | aba471f5228df8a95dc2f20ec96fa878c9d58438 (diff) | |
download | gdb-c588c53caf5aad8ebbee231437d2146359392725.zip gdb-c588c53caf5aad8ebbee231437d2146359392725.tar.gz gdb-c588c53caf5aad8ebbee231437d2146359392725.tar.bz2 |
2007-07-27 Michael Snyder <michael.snyder@access-company.com>
* server.c (main): Check for inferior exit before main loop.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbserver/server.c | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 6b169cc..9e04c04 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2007-07-27 Michael Snyder <michael.snyder@access-company.com> + + * server.c (main): Check for inferior exit before main loop. + 2007-07-18 Pedro Alves <pedro_alves@portugalmail.pt> * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 9225f66..2b9866f 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -80,6 +80,8 @@ start_inferior (char *argv[], char *statusptr) signal_pid = create_inferior (argv[0], argv); + /* FIXME: we don't actually know at this point that the create + actually succeeded. We won't know that until we wait. */ fprintf (stderr, "Process %s created; pid = %ld\n", argv[0], signal_pid); fflush (stderr); @@ -93,7 +95,8 @@ start_inferior (char *argv[], char *statusptr) atexit (restore_old_foreground_pgrp); #endif - /* Wait till we are at 1st instruction in program, return signal number. */ + /* Wait till we are at 1st instruction in program, return signal + number (assuming success). */ return mywait (statusptr, 0); } @@ -899,7 +902,9 @@ main (int argc, char *argv[]) /* Wait till we are at first instruction in program. */ signal = start_inferior (&argv[2], &status); - /* We are now stopped at the first instruction of the target process */ + /* We are now (hopefully) stopped at the first instruction of + the target process. This assumes that the target process was + successfully created. */ /* Don't report shared library events on the initial connection, even if some libraries are preloaded. */ @@ -925,6 +930,12 @@ main (int argc, char *argv[]) exit (1); } + if (status == 'W' || status == 'X') + { + fprintf (stderr, "No inferior, GDBserver exiting.\n"); + exit (1); + } + while (1) { remote_open (argv[1]); |