This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Should we exit if start_inferior fails?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]