From 12615cba8411c845b33b98cc616439c66a34f03a Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Sun, 1 Jul 2018 22:56:56 +0200 Subject: Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args to info [args|functions|locals|variables] Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args to info [args|functions|locals|variables] Main changes are: * stack.c: Add two regexp preg and treg to print_variable_and_value_data and used them inside do_print_variable_and_value to filter the variables to print. * symtab.h: Add a new function bool treg_matches_sym_type_name, that factorises type matching logic. * symtab.c: Add type/name matching logic to 'info functions|variables'. * stack.c : Add type/name matching logic to 'info args|locals'. gdb/ChangeLog 2018-10-27 Philippe Waroquiers * stack.c (print_variable_and_value_data): Add preg and treg. (print_frame_local_vars): Add quiet, regexp and t_regexp arguments, and update callers. (print_frame_arg_vars): Likewise. (prepare_reg): New function. (info_locals_command): Extract info print args and use them. (info_args_command): Likewise. (_initialize_stack): Modify on-line help. * symtab.c (treg_matches_sym_type_name): New function. (search_symbols): New arg t_regexp. (symtab_symbol_info): New args quiet, regexp, t_regexp. (info_variables_command): Extract info print args and use them. (info_functions_command): Likewise. (info_types_command): Update call to symtab_symbol_info. (_initialize_symtab): Modify on-line help. * symtab.h (treg_matches_sym_type_name): New function. (search_symbols): New t_regexp arg. --- gdb/python/python.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/python.c b/gdb/python/python.c index 8fbce78..348405e 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -743,11 +743,11 @@ gdbpy_rbreak (PyObject *self, PyObject *args, PyObject *kw) { const char **files = symtab_paths.vec.data (); - symbols = search_symbols (regex, FUNCTIONS_DOMAIN, + symbols = search_symbols (regex, FUNCTIONS_DOMAIN, NULL, symtab_paths.vec.size (), files); } else - symbols = search_symbols (regex, FUNCTIONS_DOMAIN, 0, NULL); + symbols = search_symbols (regex, FUNCTIONS_DOMAIN, NULL, 0, NULL); /* Count the number of symbols (both symbols and optionally minimal symbols) so we can correctly check the throttle limit. */ -- cgit v1.1