public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove tui_refreshing_registers
@ 2024-02-08 19:34 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-02-08 19:34 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b08b7a15590b6a0a9144a9709a1423c502de6216
commit b08b7a15590b6a0a9144a9709a1423c502de6216
Author: Tom Tromey <tom@tromey.com>
Date: Sun Dec 17 11:58:29 2023 -0700
Remove tui_refreshing_registers
The comment by tui_refreshing_registers mentions a hook that no longer
exists. However, maybe the comment is wrong.
The code paths touching tui_refreshing_registers can only be called in two places:
1. From the before_prompt observer. This is only called when a prompt
is about to be displayed.
2. From the register_changed observer. This is only called when
value_assign changes a register value.
From this it seems clear that the recursion case here cannot in fact
occur. This patch removes the variable.
Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diff:
---
gdb/tui/tui-hooks.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index bd8f99b786b..3a4eda91aa3 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -63,9 +63,6 @@ static void
tui_all_objfiles_removed (program_space *pspace)
{ tui_on_objfiles_changed (); }
-/* Prevent recursion of deprecated_register_changed_hook(). */
-static bool tui_refreshing_registers = false;
-
/* Observer for the register_changed notification. */
static void
@@ -82,12 +79,7 @@ tui_register_changed (frame_info_ptr frame, int regno)
up in the other. So we always use the selected frame here, and ignore
FRAME. */
fi = get_selected_frame (NULL);
- if (!tui_refreshing_registers)
- {
- tui_refreshing_registers = true;
- TUI_DATA_WIN->check_register_values (fi);
- tui_refreshing_registers = false;
- }
+ TUI_DATA_WIN->check_register_values (fi);
}
/* Breakpoint creation hook.
@@ -145,11 +137,7 @@ tui_refresh_frame_and_register_information ()
/* Refresh the register window if it's visible. */
if (tui_is_window_visible (DATA_WIN)
&& (frame_info_changed_p || from_stack))
- {
- tui_refreshing_registers = true;
- TUI_DATA_WIN->check_register_values (fi);
- tui_refreshing_registers = false;
- }
+ TUI_DATA_WIN->check_register_values (fi);
}
else if (!from_stack)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-08 19:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 19:34 [binutils-gdb] Remove tui_refreshing_registers Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).