aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.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/ada-lang.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/ada-lang.c')
-rw-r--r--gdb/ada-lang.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 2f0f55f..6e829f0 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3312,12 +3312,24 @@ user_select_syms (struct ada_symbol_info *syms, int nsyms, int max_results)
int *chosen = (int *) alloca (sizeof (int) * nsyms);
int n_chosen;
int first_choice = (max_results == 1) ? 1 : 2;
+ const char *select_mode = multiple_symbols_select_mode ();
if (max_results < 1)
error (_("Request to select 0 symbols!"));
if (nsyms <= 1)
return nsyms;
+ if (select_mode == multiple_symbols_cancel)
+ error (_("\
+canceled because the command is ambiguous\n\
+See set/show multiple-symbol."));
+
+ /* If select_mode is "all", then return all possible symbols.
+ Only do that if more than one symbol can be selected, of course.
+ Otherwise, display the menu as usual. */
+ if (select_mode == multiple_symbols_all && max_results > 1)
+ return nsyms;
+
printf_unfiltered (_("[0] cancel\n"));
if (max_results > 1)
printf_unfiltered (_("[1] all\n"));