(cr16c_elf_final_link_relocate): Remove duplicated return statements and
[deliverable/binutils-gdb.git] / gdb / main.c
index a419309563954375cc062ea27fbe169f26773510..0595195c1d7b06815c29484056db8851b63f36ab 100644 (file)
@@ -28,6 +28,7 @@
 #include "symfile.h"
 #include "gdbcore.h"
 
+#include "exceptions.h"
 #include "getopt.h"
 
 #include <sys/types.h>
@@ -49,12 +50,6 @@ int display_time;
 
 int display_space;
 
-/* Whether this is the async version or not.  The async version is
-   invoked on the command line with the -nw --async options.  In this
-   version, the usual command_loop is substituted by and event loop which
-   processes UI events asynchronously. */
-int event_loop_p = 1;
-
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
    do_setshow_command will free it. */
@@ -163,9 +158,6 @@ captured_main (void *data)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  /* This needs to happen before the first use of malloc.  */
-  init_malloc (NULL);
-
 #ifdef HAVE_SBRK
   lim_at_start = (char *) sbrk (0);
 #endif
@@ -199,9 +191,6 @@ captured_main (void *data)
   gdb_stdtargerr = gdb_stderr; /* for moment */
   gdb_stdtargin = gdb_stdin;   /* for moment */
 
-  /* initialize error() */
-  error_init ();
-
   /* Set the sysroot path.  */
 #ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
   gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT);
@@ -253,8 +242,6 @@ captured_main (void *data)
     };
     static struct option long_options[] =
     {
-      {"async", no_argument, &event_loop_p, 1},
-      {"noasync", no_argument, &event_loop_p, 0},
 #if defined(TUI)
       {"tui", no_argument, 0, OPT_TUI},
 #endif
@@ -311,6 +298,7 @@ captured_main (void *data)
       {"statistics", no_argument, 0, OPT_STATISTICS},
       {"write", no_argument, &write_files, 1},
       {"args", no_argument, &set_args, 1},
+     {"l", required_argument, 0, 'l'},
       {0, no_argument, 0, 0}
     };
 
@@ -527,7 +515,7 @@ extern int gdbtk_test (char *);
   }
 
   /* Initialize all files.  Give the interpreter a chance to take
-     control of the console via the deprecated_init_ui_hook().  */
+     control of the console via the deprecated_init_ui_hook ().  */
   gdb_init (argv[0]);
 
   /* Do these (and anything which might call wrap_here or *_filtered)
@@ -573,7 +561,7 @@ extern int gdbtk_test (char *);
     /* Find it.  */
     struct interp *interp = interp_lookup (interpreter_p);
     if (interp == NULL)
-      error ("Interpreter `%s' unrecognized", interpreter_p);
+      error (_("Interpreter `%s' unrecognized"), interpreter_p);
     /* Install it.  */
     if (!interp_set (interp))
       {
@@ -737,6 +725,13 @@ extern int gdbtk_test (char *);
 
   if (batch)
     {
+      if (attach_flag)
+       /* Either there was a problem executing the command in the
+          batch file aborted early, or the batch file forgot to do an
+          explicit detach.  Explicitly detach the inferior ensuring
+          that there are no zombies.  */
+       target_detach (NULL, 0);
+      
       /* We have hit the end of the batch file.  */
       exit (0);
     }
@@ -776,9 +771,9 @@ extern int gdbtk_test (char *);
       if (!SET_TOP_LEVEL ())
        {
          do_cleanups (ALL_CLEANUPS);   /* Do complete cleanup */
-         /* GUIs generally have their own command loop, mainloop, or whatever.
-            This is a good place to gain control because many error
-            conditions will end up here via longjmp(). */
+         /* GUIs generally have their own command loop, mainloop, or
+            whatever.  This is a good place to gain control because
+            many error conditions will end up here via longjmp().  */
          if (deprecated_command_loop_hook)
            deprecated_command_loop_hook ();
          else
@@ -858,6 +853,7 @@ Options:\n\n\
                      Select a specific interpreter / user interface\n\
 "), stream);
   fputs_unfiltered (_("\
+  -l TIMEOUT         Set timeout in seconds for remote debugging.\n\
   --mapped           Use mapped symbol files if supported on this system.\n\
   --nw              Do not use a window interface.\n\
   --nx               Do not read "), stream);
This page took 0.024548 seconds and 4 git commands to generate.