public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 10/14] Remove tui_refreshing_registers
Date: Sun, 17 Dec 2023 12:50:35 -0700	[thread overview]
Message-ID: <20231217-tui-regs-cleanup-v1-10-67bd0ea1e8be@tromey.com> (raw)
In-Reply-To: <20231217-tui-regs-cleanup-v1-0-67bd0ea1e8be@tromey.com>

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.
---
 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 6525f0f2b6c..e47607fefa9 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)
     {

-- 
2.43.0


  parent reply	other threads:[~2023-12-17 19:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-17 19:50 [PATCH 00/14] Cleanups for the TUi register window Tom Tromey
2023-12-17 19:50 ` [PATCH 01/14] Use pop_back in tui_register_format Tom Tromey
2023-12-17 19:50 ` [PATCH 02/14] Minor C++ cleanups in tui-regs.c Tom Tromey
2023-12-17 19:50 ` [PATCH 03/14] Simplify tui_data_window::show_register_group Tom Tromey
2023-12-18 15:42   ` Andrew Burgess
2024-01-20 17:11     ` Tom Tromey
2023-12-17 19:50 ` [PATCH 04/14] Rename tui_data_item_window -> tui_register_info Tom Tromey
2023-12-17 19:50 ` [PATCH 05/14] Remove tui_register_info::visible Tom Tromey
2023-12-18 17:29   ` Hannes Domani
2024-01-20 17:02     ` Tom Tromey
2023-12-18 19:00   ` Andrew Burgess
2024-01-20 17:05     ` Tom Tromey
2023-12-17 19:50 ` [PATCH 06/14] Move scrollok call in register window Tom Tromey
2023-12-18 19:28   ` Andrew Burgess
2023-12-18 23:33     ` Tom Tromey
2023-12-17 19:50 ` [PATCH 07/14] Simplify update_register_data Tom Tromey
2023-12-18 19:48   ` Andrew Burgess
2024-01-20 17:06     ` Tom Tromey
2023-12-17 19:50 ` [PATCH 08/14] Remove the TUI register window rerender overload Tom Tromey
2023-12-18 19:54   ` Andrew Burgess
2024-01-20 17:17     ` Tom Tromey
2023-12-17 19:50 ` [PATCH 09/14] Simplify tui_data_win::erase_data_content Tom Tromey
2023-12-17 19:50 ` Tom Tromey [this message]
2023-12-17 19:50 ` [PATCH 11/14] Remove redundant check from tui_refresh_frame_and_register_information Tom Tromey
2023-12-18 17:32   ` Hannes Domani
2023-12-18 23:35     ` Tom Tromey
2023-12-19 10:26       ` Andrew Burgess
2024-01-20 18:21         ` Tom Tromey
2023-12-17 19:50 ` [PATCH 12/14] Return void from tui_show_frame_info Tom Tromey
2023-12-17 19:50 ` [PATCH 13/14] Rename show_registers -> set_register_group Tom Tromey
2023-12-17 19:50 ` [PATCH 14/14] Update TUI register window when the inferior exits Tom Tromey
2023-12-18 14:07 ` [PATCH 00/14] Cleanups for the TUi register window Tom de Vries
2023-12-19 10:31 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231217-tui-regs-cleanup-v1-10-67bd0ea1e8be@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).