frame, backtrace: allow targets to supply a frame unwinder
[deliverable/binutils-gdb.git] / gdb / main.c
index 11f4b03a3da2ea164d4b5dc2776b21320d515496..efb49f5d61d29ff9e13743b4d0164f076f5a45ea 100644 (file)
@@ -1,6 +1,6 @@
 /* Top level stuff for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2013 Free Software Foundation, Inc.
+   Copyright (C) 1986-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "getopt.h"
 
 #include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <ctype.h>
 
-#include "gdb_string.h"
+#include <string.h>
 #include "event-loop.h"
 #include "ui-out.h"
 
@@ -98,6 +98,13 @@ int return_child_result_value = -1;
 /* GDB as it has been invoked from the command line (i.e. argv[0]).  */
 static char *gdb_program_name;
 
+/* Return read only pointer to GDB_PROGRAM_NAME.  */
+const char *
+get_gdb_program_name (void)
+{
+  return gdb_program_name;
+}
+
 static void print_gdb_help (struct ui_file *);
 
 /* Relocate a file or directory.  PROGNAME is the name by which gdb
@@ -581,19 +588,14 @@ captured_main (void *data)
            xfree (interpreter_p);
            interpreter_p = xstrdup (INTERP_INSIGHT);
 #endif
-           use_windows = 1;
            break;
          case OPT_NOWINDOWS:
            /* -nw is equivalent to -i=console.  */
            xfree (interpreter_p);
            interpreter_p = xstrdup (INTERP_CONSOLE);
-           use_windows = 0;
            break;
          case 'f':
            annotation_level = 1;
-           /* We have probably been invoked from emacs.  Disable
-              window interface.  */
-           use_windows = 0;
            break;
          case 's':
            symarg = optarg;
@@ -737,13 +739,6 @@ captured_main (void *data)
          }
       }
 
-    /* If --help or --version or --configuration, disable window
-       interface.  */
-    if (print_help || print_version || print_configuration)
-      {
-       use_windows = 0;
-      }
-
     if (batch_flag)
       quiet = 1;
   }
@@ -950,8 +945,8 @@ captured_main (void *data)
          catch_command_errors returns non-zero on success!  */
       if (catch_command_errors (exec_file_attach, execarg,
                                !batch_flag, RETURN_MASK_ALL))
-       catch_command_errors (symbol_file_add_main, symarg,
-                             !batch_flag, RETURN_MASK_ALL);
+       catch_command_errors_const (symbol_file_add_main, symarg,
+                                   !batch_flag, RETURN_MASK_ALL);
     }
   else
     {
@@ -959,8 +954,8 @@ captured_main (void *data)
        catch_command_errors (exec_file_attach, execarg,
                              !batch_flag, RETURN_MASK_ALL);
       if (symarg != NULL)
-       catch_command_errors (symbol_file_add_main, symarg,
-                             !batch_flag, RETURN_MASK_ALL);
+       catch_command_errors_const (symbol_file_add_main, symarg,
+                                   !batch_flag, RETURN_MASK_ALL);
     }
 
   if (corearg && pidarg)
@@ -1065,7 +1060,6 @@ captured_main (void *data)
 int
 gdb_main (struct captured_main_args *args)
 {
-  use_windows = args->use_windows;
   catch_errors (captured_main, args, "", RETURN_MASK_ALL);
   /* The only way to end up here is by an error (normal exit is
      handled by quit_force()), hence always return an error status.  */
This page took 0.02597 seconds and 4 git commands to generate.