diff options
author | Doug Evans <dje@google.com> | 2014-05-16 12:15:10 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-05-16 12:15:10 -0700 |
commit | 8d551b0239b795065ecd2cb2bd3cae2e9ee2a7df (patch) | |
tree | 7514560ea6c4786e6ec8e883e5cdc8a6312eba5c /gdb/top.c | |
parent | 18848e288ca9d1ca242cce667419bbb6728442fc (diff) | |
download | gdb-8d551b0239b795065ecd2cb2bd3cae2e9ee2a7df.zip gdb-8d551b0239b795065ecd2cb2bd3cae2e9ee2a7df.tar.gz gdb-8d551b0239b795065ecd2cb2bd3cae2e9ee2a7df.tar.bz2 |
New command line option -D.
* NEWS: Mention it.
* main.c (set_gdb_data_directory): New function.
(captured_main): Recognize -D. Flag error for --data-directory "".
Call set_gdb_data_directory.
(print_gdb_help): Print --data-directory, -D.
* main.h (set_gdb_data_directory): Declare.
* top.c (staged_gdb_datadir): New static global.
(set_gdb_datadir): Call set_gdb_data_directory
(show_gdb_datadir): New function.
(init_main): Update init of data-directory parameter.
testsuite/
* gdb.base/catch-syscall.exp (test_catch_syscall_fail_nodatadir):
Update.
(do_syscall_tests_without_xml): Update.
doc/
* gdb.texinfo (Mode Options): Add -D.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1668,14 +1668,28 @@ show_exec_done_display_p (struct ui_file *file, int from_tty, value); } +/* New values of the "data-directory" parameter are staged here. */ +static char *staged_gdb_datadir; + /* "set" command for the gdb_datadir configuration variable. */ static void set_gdb_datadir (char *args, int from_tty, struct cmd_list_element *c) { + set_gdb_data_directory (staged_gdb_datadir); observer_notify_gdb_datadir_changed (); } +/* "show" command for the gdb_datadir configuration variable. */ + +static void +show_gdb_datadir (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + fprintf_filtered (file, _("GDB's data directory is \"%s\".\n"), + gdb_datadir); +} + static void set_history_filename (char *args, int from_tty, struct cmd_list_element *c) { @@ -1793,11 +1807,11 @@ Use \"on\" to enable the notification, and \"off\" to disable it."), &setlist, &showlist); add_setshow_filename_cmd ("data-directory", class_maintenance, - &gdb_datadir, _("Set GDB's data directory."), + &staged_gdb_datadir, _("Set GDB's data directory."), _("Show GDB's data directory."), _("\ When set, GDB uses the specified path to search for data files."), - set_gdb_datadir, NULL, + set_gdb_datadir, show_gdb_datadir, &setlist, &showlist); } |