Implement a new command to show GDB build-time configuration parameters.
[deliverable/binutils-gdb.git] / gdb / main.c
index 8823c8247e72b1c6f35ff7e20f62e3f2d3c79830..531a2c3561978a98dacfa50b606cdecf3fe80aa7 100644 (file)
@@ -321,6 +321,7 @@ captured_main (void *data)
      initializer.  */
   static int print_help;
   static int print_version;
+  static int print_configuration;
 
   /* Pointers to all arguments of --command option.  */
   VEC (cmdarg_s) *cmdarg_vec = NULL;
@@ -483,6 +484,7 @@ captured_main (void *data)
       {"command", required_argument, 0, 'x'},
       {"eval-command", required_argument, 0, 'X'},
       {"version", no_argument, &print_version, 1},
+      {"configuration", no_argument, &print_configuration, 1},
       {"x", required_argument, 0, 'x'},
       {"ex", required_argument, 0, 'X'},
       {"init-command", required_argument, 0, OPT_IX},
@@ -726,8 +728,9 @@ captured_main (void *data)
          }
       }
 
-    /* If --help or --version, disable window interface.  */
-    if (print_help || print_version)
+    /* If --help or --version or --configuration, disable window
+       interface.  */
+    if (print_help || print_version || print_configuration)
       {
        use_windows = 0;
       }
@@ -818,6 +821,14 @@ captured_main (void *data)
       exit (0);
     }
 
+  if (print_configuration)
+    {
+      print_gdb_configuration (gdb_stdout);
+      wrap_here ("");
+      printf_filtered ("\n");
+      exit (0);
+    }
+
   /* FIXME: cagney/2003-02-03: The big hack (part 1 of 2) that lets
      GDB retain the old MI1 interpreter startup behavior.  Output the
      copyright message before the interpreter is installed.  That way
@@ -1129,6 +1140,7 @@ Options:\n\n\
 #endif
   fputs_unfiltered (_("\
   --version          Print version information and then exit.\n\
+  --configuration    Print details about GDB configuration and then exit.\n\
   -w                 Use a window interface.\n\
   --write            Set writing into executable and core files.\n\
   --xdb              XDB compatibility mode.\n\
This page took 0.025092 seconds and 4 git commands to generate.