aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-04-12 08:57:07 +0000
committerEli Zaretskii <eliz@gnu.org>2013-04-12 08:57:07 +0000
commit6eaaf48b1c3ff871cdcd180c172a72271fe29588 (patch)
treec1ce5c5514f0ede25a49d6b52eabb57286ca3f73 /gdb/main.c
parent3bcd3d1135c711b312567ad14b32dee411ac3fd4 (diff)
downloadgdb-6eaaf48b1c3ff871cdcd180c172a72271fe29588.zip
gdb-6eaaf48b1c3ff871cdcd180c172a72271fe29588.tar.gz
gdb-6eaaf48b1c3ff871cdcd180c172a72271fe29588.tar.bz2
Implement a new command to show GDB build-time configuration parameters.
* top.c (print_gdb_configuration): New function, displays the details about GDB configure-time parameters. (print_gdb_version): Mention "show configuration". * cli/cli-cmds.c (show_configuration): New function. (_initialize_cli_cmds): Add the "show configuration" command. * main.c (captured_main) <print_configuration>: New static var. <long_options>: Use it. If --configuration was given, call print_gdb_configuration. * doc/gdb.texinfo (Mode Options): Document '-configuration'. (Help): Document "show configuration". (Bug Reporting): Add requirements to include the configuration details in bug reports.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 8823c82..531a2c3 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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\