aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 7c4cf94..8b29ab5 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2426,12 +2426,7 @@ print_frame_local_vars (struct frame_info *frame,
struct info_print_options
{
bool quiet = false;
- char *type_regexp = nullptr;
-
- ~info_print_options ()
- {
- xfree (type_regexp);
- }
+ std::string type_regexp;
};
/* The options used by the 'info locals' and 'info args' commands. */
@@ -2490,9 +2485,11 @@ info_locals_command (const char *args, int from_tty)
if (args != nullptr && *args == '\0')
args = nullptr;
- print_frame_local_vars (get_selected_frame (_("No frame selected.")),
- opts.quiet, args, opts.type_regexp,
- 0, gdb_stdout);
+ print_frame_local_vars
+ (get_selected_frame (_("No frame selected.")),
+ opts.quiet, args,
+ opts.type_regexp.empty () ? nullptr : opts.type_regexp.c_str (),
+ 0, gdb_stdout);
}
/* Iterate over all the argument variables in block B. */
@@ -2601,8 +2598,11 @@ info_args_command (const char *args, int from_tty)
if (args != nullptr && *args == '\0')
args = nullptr;
- print_frame_arg_vars (get_selected_frame (_("No frame selected.")),
- opts.quiet, args, opts.type_regexp, gdb_stdout);
+ print_frame_arg_vars
+ (get_selected_frame (_("No frame selected.")),
+ opts.quiet, args,
+ opts.type_regexp.empty () ? nullptr : opts.type_regexp.c_str (),
+ gdb_stdout);
}
/* Return the symbol-block in which the selected frame is executing.