aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-04-03 21:39:16 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-04-03 21:39:16 +0000
commit717d2f5a05d436766fb431411e7768a2886bca42 (patch)
tree018e1ea556ce410826f4e649faa684c3730e848a /gdb/symtab.c
parentf73634e546146a5176f76153a72c3d12dfc3ae68 (diff)
downloadgdb-717d2f5a05d436766fb431411e7768a2886bca42.zip
gdb-717d2f5a05d436766fb431411e7768a2886bca42.tar.gz
gdb-717d2f5a05d436766fb431411e7768a2886bca42.tar.bz2
* symtab.c (multiple_symbols_ask, multiple_symbols_all)
(multiple_symbols_cancel): New constants. (multiple_symbols_modes, multiple_symbols_mode): New static globals. (multiple_symbols_select_mode): New function. (_initialize_symtab): Add new set/show multiple-symbols commands. * symtab.h (multiple_symbols_ask, multiple_symbols_all) (multiple_symbols_cancel, multiple_symbols_select_mode): Declare. * ada-lang.c (user_select_syms): Add handling of new multiple-symbols setting. * linespec.c (decode_line_2): Likewise.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index ddd2310..aa401ad 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -124,6 +124,30 @@ void _initialize_symtab (void);
/* */
+/* Allow the user to configure the debugger behavior with respect
+ to multiple-choice menus when more than one symbol matches during
+ a symbol lookup. */
+
+const char const multiple_symbols_ask[] = "ask";
+const char const multiple_symbols_all[] = "all";
+const char const multiple_symbols_cancel[] = "cancel";
+static const char *multiple_symbols_modes[] =
+{
+ multiple_symbols_ask,
+ multiple_symbols_all,
+ multiple_symbols_cancel,
+ NULL
+};
+static const char *multiple_symbols_mode = multiple_symbols_all;
+
+/* Read-only accessor to AUTO_SELECT_MODE. */
+
+const char *
+multiple_symbols_select_mode (void)
+{
+ return multiple_symbols_mode;
+}
+
/* The single non-language-specific builtin type */
struct type *builtin_type_error;
@@ -4422,6 +4446,15 @@ All global and static variable names, or those matching REGEXP."));
All global and static variable names, or those matching REGEXP."));
}
+ add_setshow_enum_cmd ("multiple-symbols", no_class,
+ multiple_symbols_modes, &multiple_symbols_mode,
+ _("\
+Set the debugger behavior when more than one symbol are possible matches\n\
+in an expression."), _("\
+Show how the debugger handles ambiguities in expressions."), _("\
+Valid values are \"ask\", \"all\", \"cancel\", and the default is \"all\"."),
+ NULL, NULL, &setlist, &showlist);
+
/* Initialize the one built-in type that isn't language dependent... */
builtin_type_error = init_type (TYPE_CODE_ERROR, 0, 0,
"<unknown type>", (struct objfile *) NULL);