diff options
author | Tom Tromey <tom@tromey.com> | 2023-10-28 11:46:33 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-10-30 21:47:36 -0600 |
commit | 1f9e9ea5b7cd1554db5a5e9da92a6882f1cce40e (patch) | |
tree | 5461232c2d5f2a3b211f506b826cc861190db590 /gdb | |
parent | a05b22b6c7ff0f48b92086f523f8227d26c84f49 (diff) | |
download | gdb-1f9e9ea5b7cd1554db5a5e9da92a6882f1cce40e.zip gdb-1f9e9ea5b7cd1554db5a5e9da92a6882f1cce40e.tar.gz gdb-1f9e9ea5b7cd1554db5a5e9da92a6882f1cce40e.tar.bz2 |
Remove some frame invalidation code
I stumbled across a few spots that mention that a function
"invalidates frame" and also assignments of NULL to a frame_info_ptr.
This code isn't harmful, but is also unnecessary since the
introduction of frame_info_ptr -- nowadays frame invalidations are
handled automatically.
Regression tested on x86-64 Fedora 38.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/breakpoint.c | 3 | ||||
-rw-r--r-- | gdb/printcmd.c | 8 | ||||
-rw-r--r-- | gdb/stack.c | 11 |
3 files changed, 3 insertions, 19 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 828c99c..fe09dbc 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10952,9 +10952,6 @@ until_break_command (const char *arg, int from_tty, int anywhere) lj_deleter.emplace (thread); } - /* set_momentary_breakpoint could invalidate FRAME. */ - frame = NULL; - /* If the user told us to continue until a specified location, we don't specify a frame at which we need to stop. Otherwise, specify the selected frame, because we want to stop only at the diff --git a/gdb/printcmd.c b/gdb/printcmd.c index b9b6a3b..06cc531 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2391,9 +2391,7 @@ clear_dangling_display_expressions (struct objfile *objfile) struct symbol. NAME is the name to print; if NULL then VAR's print name will be used. STREAM is the ui_file on which to print the value. INDENT specifies the number of indent levels to print - before printing the variable name. - - This function invalidates FRAME. */ + before printing the variable name. */ void print_variable_and_value (const char *name, struct symbol *var, @@ -2420,10 +2418,6 @@ print_variable_and_value (const char *name, struct symbol *var, get_user_print_options (&opts); opts.deref_ref = true; common_val_print_checked (val, stream, indent, &opts, current_language); - - /* common_val_print invalidates FRAME when a pretty printer calls inferior - function. */ - frame = NULL; } catch (const gdb_exception_error &except) { diff --git a/gdb/stack.c b/gdb/stack.c index 0b35d62..39dcefa 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -2326,9 +2326,7 @@ prepare_reg (const char *regexp, gdb::optional<compiled_regex> *reg) If T_REGEXP is not NULL, only print local variables whose type matches T_REGEXP. If no local variables have been printed and !QUIET, prints a message - explaining why no local variables could be printed. - - This function will invalidate FRAME. */ + explaining why no local variables could be printed. */ static void print_frame_local_vars (frame_info_ptr frame, @@ -2490,9 +2488,7 @@ iterate_over_block_arg_vars (const struct block *b, If T_REGEXP is not NULL, only print argument variables whose type matches T_REGEXP. If no argument variables have been printed and !QUIET, prints a message - explaining why no argument variables could be printed. - - This function will invalidate FRAME. */ + explaining why no argument variables could be printed. */ static void print_frame_arg_vars (frame_info_ptr frame, @@ -2531,9 +2527,6 @@ print_frame_arg_vars (frame_info_ptr frame, iterate_over_block_arg_vars (func->value_block (), cb_data); - /* do_print_variable_and_value invalidates FRAME. */ - frame = NULL; - if (!cb_data.values_printed && !quiet) { if (regexp == NULL && t_regexp == NULL) |