aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c44
1 files changed, 14 insertions, 30 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 01118c6..4669112 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4687,6 +4687,9 @@ symtab_symbol_info (bool quiet,
gdb_assert (kind <= TYPES_DOMAIN);
+ if (regexp != nullptr && *regexp == '\0')
+ regexp = nullptr;
+
/* Must make sure that if we're interrupted, symbols gets freed. */
std::vector<symbol_search> symbols = search_symbols (regexp, kind,
t_regexp, 0, NULL);
@@ -4742,47 +4745,28 @@ symtab_symbol_info (bool quiet,
}
}
+/* Implement the 'info variables' command. */
+
static void
info_variables_command (const char *args, int from_tty)
{
- std::string regexp;
- std::string t_regexp;
- bool quiet = false;
-
- while (args != NULL
- && extract_info_print_args (&args, &quiet, &regexp, &t_regexp))
- ;
+ info_print_options opts;
+ extract_info_print_options (&opts, &args);
- if (args != NULL)
- report_unrecognized_option_error ("info variables", args);
-
- symtab_symbol_info (quiet,
- regexp.empty () ? NULL : regexp.c_str (),
- VARIABLES_DOMAIN,
- t_regexp.empty () ? NULL : t_regexp.c_str (),
- from_tty);
+ symtab_symbol_info (opts.quiet, args, VARIABLES_DOMAIN,
+ opts.type_regexp, from_tty);
}
+/* Implement the 'info functions' command. */
static void
info_functions_command (const char *args, int from_tty)
{
- std::string regexp;
- std::string t_regexp;
- bool quiet = false;
-
- while (args != NULL
- && extract_info_print_args (&args, &quiet, &regexp, &t_regexp))
- ;
-
- if (args != NULL)
- report_unrecognized_option_error ("info functions", args);
+ info_print_options opts;
+ extract_info_print_options (&opts, &args);
- symtab_symbol_info (quiet,
- regexp.empty () ? NULL : regexp.c_str (),
- FUNCTIONS_DOMAIN,
- t_regexp.empty () ? NULL : t_regexp.c_str (),
- from_tty);
+ symtab_symbol_info (opts.quiet, args, FUNCTIONS_DOMAIN,
+ opts.type_regexp, from_tty);
}