This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Should we exit if start_inferior fails?
- From: Qunying Pan <qunyingpan at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: qunyingpan at gmail dot com
- Date: Thu, 21 Jul 2005 11:11:02 -0700
- Subject: Should we exit if start_inferior fails?
- Reply-to: Qunying Pan <qunyingpan at gmail dot com>
Hello:
If start_inferior fails for some reason, do you think gdbserver should
exit instead of hanging there? Does this patch acceptable? Thanks,
Qunying
--- gdb-6.3/gdb.orig/gdbserver/server.c 2005-07-19 12:03:15.000000000 -0700
+++ gdb-6.3/gdb/gdbserver/server.c 2005-07-20 16:55:54.000000000 -0700
@@ -476,6 +476,12 @@ main (int argc, char *argv[])
/* Wait till we are at first instruction in program. */
signal = start_inferior (&argv[2], &status);
+ if (signal == 0177)
+ {
+ fprintf (stderr, "Exiting\n");
+ exit (1);
+ }
+
/* We are now stopped at the first instruction of the target process */
}
else