Should we exit if start_inferior fails?

Qunying Pan qunyingpan@gmail.com
Thu Jul 21 18:11:00 GMT 2005


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



More information about the Gdb-patches mailing list