public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Rename TUI status code to follow the docs
@ 2023-12-08 17:43 Tom Tromey
  2023-12-08 17:43 ` [PATCH 1/2] Rename tui-stack -> tui-status Tom Tromey
  2023-12-08 17:43 ` [PATCH 2/2] Rename TUI locator window -> status Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Tromey @ 2023-12-08 17:43 UTC (permalink / raw)
  To: gdb-patches

The TUI status window is called the "locator" in the code and appears
in tui-stack.[ch].  This has always confused me, and so I finally got
around to writing this series to rename both the files and the class.

---
Tom Tromey (2):
      Rename tui-stack -> tui-status
      Rename TUI locator window -> status

 gdb/Makefile.in                       |  4 ++--
 gdb/tui/tui-data.h                    |  2 +-
 gdb/tui/tui-disasm.c                  |  2 +-
 gdb/tui/tui-hooks.c                   |  2 +-
 gdb/tui/tui-layout.c                  |  6 +++---
 gdb/tui/tui-location.c                |  6 +++---
 gdb/tui/tui-location.h                |  6 +++---
 gdb/tui/tui-source.c                  |  2 +-
 gdb/tui/{tui-stack.c => tui-status.c} | 28 ++++++++++++++--------------
 gdb/tui/{tui-stack.h => tui-status.h} | 14 +++++++-------
 gdb/tui/tui-win.c                     |  2 +-
 gdb/tui/tui-wingeneral.c              |  2 +-
 gdb/tui/tui-winsource.c               |  2 +-
 gdb/tui/tui.c                         |  4 ++--
 14 files changed, 41 insertions(+), 41 deletions(-)
---
base-commit: 7543c960b00ddea23f6105eff4358ec214a7f93c
change-id: 20231208-tui-status-rename-ec68ef88991e

Best regards,
-- 
Tom Tromey <tom@tromey.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] Rename tui-stack -> tui-status
  2023-12-08 17:43 [PATCH 0/2] Rename TUI status code to follow the docs Tom Tromey
@ 2023-12-08 17:43 ` Tom Tromey
  2023-12-13 13:35   ` Alexandra Petlanova Hajkova
  2023-12-08 17:43 ` [PATCH 2/2] Rename TUI locator window -> status Tom Tromey
  1 sibling, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2023-12-08 17:43 UTC (permalink / raw)
  To: gdb-patches

The TUI status line is called the "status" window in the
documentation, but not in the source.  There, the relevant files are
named "tui-stack", which to me makes it sound like they have something
to do with backtraces.  This patch renames them to "tui-status".
---
 gdb/Makefile.in                       | 4 ++--
 gdb/tui/tui-disasm.c                  | 2 +-
 gdb/tui/tui-hooks.c                   | 2 +-
 gdb/tui/tui-layout.c                  | 2 +-
 gdb/tui/tui-location.c                | 2 +-
 gdb/tui/tui-source.c                  | 2 +-
 gdb/tui/{tui-stack.c => tui-status.c} | 2 +-
 gdb/tui/{tui-stack.h => tui-status.h} | 0
 gdb/tui/tui-win.c                     | 2 +-
 gdb/tui/tui-wingeneral.c              | 2 +-
 gdb/tui/tui-winsource.c               | 2 +-
 gdb/tui/tui.c                         | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 3510577f090..c6d60f69d86 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -321,7 +321,7 @@ SUBDIR_TUI_SRCS = \
 	tui/tui-out.c \
 	tui/tui-regs.c \
 	tui/tui-source.c \
-	tui/tui-stack.c \
+	tui/tui-status.c \
 	tui/tui-win.c \
 	tui/tui-wingeneral.c \
 	tui/tui-winsource.c
@@ -1605,7 +1605,7 @@ HFILES_NO_SRCDIR = \
 	tui/tui-out.h \
 	tui/tui-regs.h \
 	tui/tui-source.h \
-	tui/tui-stack.h \
+	tui/tui-status.h \
 	tui/tui-win.h \
 	tui/tui-wingeneral.h \
 	tui/tui-winsource.h \
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index b5d5a4cc20f..38ad4bd8517 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -33,7 +33,7 @@
 #include "tui/tui-win.h"
 #include "tui/tui-layout.h"
 #include "tui/tui-winsource.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-file.h"
 #include "tui/tui-disasm.h"
 #include "tui/tui-source.h"
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 6525f0f2b6c..d6becd5a777 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -44,7 +44,7 @@
 #include "tui/tui-io.h"
 #include "tui/tui-regs.h"
 #include "tui/tui-win.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-winsource.h"
 
 #include "gdb_curses.h"
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index a4cb5a8b7bf..189954de535 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -35,7 +35,7 @@
 #include "tui/tui-command.h"
 #include "tui/tui-data.h"
 #include "tui/tui-wingeneral.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-regs.h"
 #include "tui/tui-win.h"
 #include "tui/tui-winsource.h"
diff --git a/gdb/tui/tui-location.c b/gdb/tui/tui-location.c
index 9d6d29bcf01..da41d63631e 100644
--- a/gdb/tui/tui-location.c
+++ b/gdb/tui/tui-location.c
@@ -17,7 +17,7 @@
 
 #include "defs.h"
 #include "tui/tui.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-data.h"
 #include "tui/tui-location.h"
 #include "symtab.h"
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index bce381add28..6601fa31a48 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -33,7 +33,7 @@
 #include "tui/tui.h"
 #include "tui/tui-data.h"
 #include "tui/tui-io.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-win.h"
 #include "tui/tui-winsource.h"
 #include "tui/tui-source.h"
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-status.c
similarity index 99%
rename from gdb/tui/tui-stack.c
rename to gdb/tui/tui-status.c
index 723d6268aad..9c99312d7dc 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-status.c
@@ -31,7 +31,7 @@
 #include "source.h"
 #include "tui/tui.h"
 #include "tui/tui-data.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-source.h"
 #include "tui/tui-winsource.h"
diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-status.h
similarity index 100%
rename from gdb/tui/tui-stack.h
rename to gdb/tui/tui-status.h
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 9219c1f0184..28d894b9e41 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -44,7 +44,7 @@
 #include "tui/tui-data.h"
 #include "tui/tui-layout.h"
 #include "tui/tui-wingeneral.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-regs.h"
 #include "tui/tui-disasm.h"
 #include "tui/tui-source.h"
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index af4fc746cba..f313eb337bc 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -25,7 +25,7 @@
 #include "tui/tui-io.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-win.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "cli/cli-style.h"
 
 #include "gdb_curses.h"
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 52c0b5b69a4..32089c1229c 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -33,7 +33,7 @@
 #include "tui/tui.h"
 #include "tui/tui-data.h"
 #include "tui/tui-io.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-win.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-winsource.h"
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 33aced2e7e3..e1c822ce685 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -28,7 +28,7 @@
 #include "tui/tui-layout.h"
 #include "tui/tui-io.h"
 #include "tui/tui-regs.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-status.h"
 #include "tui/tui-win.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-winsource.h"

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Rename TUI locator window -> status
  2023-12-08 17:43 [PATCH 0/2] Rename TUI status code to follow the docs Tom Tromey
  2023-12-08 17:43 ` [PATCH 1/2] Rename tui-stack -> tui-status Tom Tromey
@ 2023-12-08 17:43 ` Tom Tromey
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2023-12-08 17:43 UTC (permalink / raw)
  To: gdb-patches

The TUI status window is called the "locator" in the source, but
"status" in the documentation.  Whenever I've needed to find the code,
I've had to search to "locate" it (ha, ha).  This patch renames the
window to match the public name of the window.
---
 gdb/tui/tui-data.h     |  2 +-
 gdb/tui/tui-layout.c   |  4 ++--
 gdb/tui/tui-location.c |  4 ++--
 gdb/tui/tui-location.h |  6 +++---
 gdb/tui/tui-status.c   | 26 +++++++++++++-------------
 gdb/tui/tui-status.h   | 14 +++++++-------
 gdb/tui/tui.c          |  2 +-
 7 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 76d0de3a3f0..847ad6da714 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -298,7 +298,7 @@ extern struct tui_win_info *tui_win_list[MAX_MAJOR_WINDOWS];
 #define TUI_CMD_WIN \
   (gdb::checked_static_cast<tui_cmd_window *> (tui_win_list[CMD_WIN]))
 #define TUI_STATUS_WIN \
-  (gdb::checked_static_cast<tui_locator_window *> (tui_win_list[STATUS_WIN]))
+  (gdb::checked_static_cast<tui_status_window *> (tui_win_list[STATUS_WIN]))
 
 /* All the windows that are currently instantiated, in layout
    order.  */
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 189954de535..c0ff7ee6c10 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -306,7 +306,7 @@ tui_win_info::resize (int height_, int width_,
 
 \f
 
-/* Helper function to create one of the built-in (non-locator)
+/* Helper function to create one of the built-in (non-status)
    windows.  */
 
 template<enum tui_win_type V, class T>
@@ -369,7 +369,7 @@ initialize_known_windows ()
 						    tui_disasm_window>);
   known_window_types.emplace (STATUS_NAME,
 			       make_standard_window<STATUS_WIN,
-						    tui_locator_window>);
+						    tui_status_window>);
 }
 
 /* See tui-layout.h.  */
diff --git a/gdb/tui/tui-location.c b/gdb/tui/tui-location.c
index da41d63631e..759719816c3 100644
--- a/gdb/tui/tui-location.c
+++ b/gdb/tui/tui-location.c
@@ -48,7 +48,7 @@ tui_location_tracker::set_location (struct gdbarch *gdbarch,
   m_gdbarch = gdbarch;
 
   if (location_changed_p)
-    tui_show_locator_content ();
+    tui_show_status_content ();
 
   return location_changed_p;
 }
@@ -61,7 +61,7 @@ tui_location_tracker::set_location (struct symtab *symtab)
   bool location_changed_p = set_fullname (symtab);
 
   if (location_changed_p)
-    tui_show_locator_content ();
+    tui_show_status_content ();
 
   return location_changed_p;
 }
diff --git a/gdb/tui/tui-location.h b/gdb/tui/tui-location.h
index 514d2da5b8f..ebe493ecc9f 100644
--- a/gdb/tui/tui-location.h
+++ b/gdb/tui/tui-location.h
@@ -32,9 +32,9 @@
 
 struct tui_location_tracker
 {
-  /* Update the current location with the provided arguments.  Returns true
-     if any of the locator's fields were actually changed, and false
-     otherwise.  */
+  /* Update the current location with the provided arguments.  Returns
+     true if any of the status window's fields were actually changed,
+     and false otherwise.  */
   bool set_location (struct gdbarch *gdbarch,
 		     const struct symtab_and_line &sal,
 		     const char *procname);
diff --git a/gdb/tui/tui-status.c b/gdb/tui/tui-status.c
index 9c99312d7dc..c5fce8099bf 100644
--- a/gdb/tui/tui-status.c
+++ b/gdb/tui/tui-status.c
@@ -1,4 +1,4 @@
-/* TUI display locator.
+/* TUI status line.
 
    Copyright (C) 1998-2023 Free Software Foundation, Inc.
 
@@ -58,7 +58,7 @@ static const std::string SINGLE_KEY = "(SingleKey)";
 \f
 
 std::string
-tui_locator_window::make_status_line () const
+tui_status_window::make_status_line () const
 {
   char line_buf[50];
   int status_size;
@@ -143,7 +143,7 @@ tui_locator_window::make_status_line () const
 	}
     }
 
-  /* Now create the locator line from the string version of the
+  /* Now create the status line from the string version of the
      elements.  */
   string_file string;
 
@@ -226,7 +226,7 @@ tui_get_function_from_frame (frame_info_ptr fi)
 }
 
 void
-tui_locator_window::rerender ()
+tui_status_window::rerender ()
 {
   gdb_assert (handle != NULL);
 
@@ -255,7 +255,7 @@ tui_locator_window::rerender ()
 bool
 tui_show_frame_info (frame_info_ptr fi)
 {
-  bool locator_changed_p;
+  bool status_changed_p;
 
   if (fi != nullptr)
     {
@@ -269,13 +269,13 @@ tui_show_frame_info (frame_info_ptr fi)
       else
 	func_name = _("<unavailable>");
 
-      locator_changed_p
+      status_changed_p
 	= tui_location.set_location (get_frame_arch (fi), sal, func_name);
 
-      /* If the locator information has not changed, then frame information has
+      /* If the status information has not changed, then frame information has
 	 not changed.  If frame information has not changed, then the windows'
 	 contents will not change.  So don't bother refreshing the windows.  */
-      if (!locator_changed_p)
+      if (!status_changed_p)
 	return false;
 
       for (struct tui_source_window_base *win_info : tui_source_windows ())
@@ -288,9 +288,9 @@ tui_show_frame_info (frame_info_ptr fi)
     {
       symtab_and_line sal {};
 
-      locator_changed_p = tui_location.set_location (NULL, sal, "");
+      status_changed_p = tui_location.set_location (NULL, sal, "");
 
-      if (!locator_changed_p)
+      if (!status_changed_p)
 	return false;
 
       for (struct tui_source_window_base *win_info : tui_source_windows ())
@@ -301,7 +301,7 @@ tui_show_frame_info (frame_info_ptr fi)
 }
 
 void
-tui_show_locator_content ()
+tui_show_status_content ()
 {
   if (tui_is_window_visible (STATUS_WIN))
     TUI_STATUS_WIN->rerender ();
@@ -322,7 +322,7 @@ void
 _initialize_tui_stack ()
 {
   add_com ("update", class_tui, tui_update_command,
-	   _("Update the source window and locator to "
-	     "display the current execution point.\n\
+	   _("\
+Update the source window to display the current execution point.\n\
 Usage: update"));
 }
diff --git a/gdb/tui/tui-status.h b/gdb/tui/tui-status.h
index ca95b2bf78a..31e9643ae35 100644
--- a/gdb/tui/tui-status.h
+++ b/gdb/tui/tui-status.h
@@ -1,4 +1,4 @@
-/* TUI display locator.
+/* TUI status line.
 
    Copyright (C) 1998-2023 Free Software Foundation, Inc.
 
@@ -19,8 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef TUI_TUI_STACK_H
-#define TUI_TUI_STACK_H
+#ifndef TUI_TUI_STATUS_H
+#define TUI_TUI_STATUS_H
 
 #include "tui/tui-data.h"
 
@@ -28,11 +28,11 @@ class frame_info_ptr;
 
 /* Locator window class.  */
 
-struct tui_locator_window
+struct tui_status_window
   : public tui_nofocus_window, tui_noscroll_window, tui_oneline_window,
     tui_nobox_window
 {
-  tui_locator_window () = default;
+  tui_status_window () = default;
 
   const char *name () const override
   {
@@ -50,7 +50,7 @@ struct tui_locator_window
   std::string make_status_line () const;
 };
 
-extern void tui_show_locator_content (void);
+extern void tui_show_status_content (void);
 extern bool tui_show_frame_info (frame_info_ptr);
 
-#endif /* TUI_TUI_STACK_H */
+#endif /* TUI_TUI_STATUS_H */
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index e1c822ce685..7e2dff3a832 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -285,7 +285,7 @@ tui_set_key_mode (enum tui_key_mode mode)
   tui_current_key_mode = mode;
   rl_set_keymap (mode == TUI_SINGLE_KEY_MODE
 		 ? tui_keymap : tui_readline_standard_keymap);
-  tui_show_locator_content ();
+  tui_show_status_content ();
 }
 
 /* Initialize readline and configure the keymap for the switching

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Rename tui-stack -> tui-status
  2023-12-08 17:43 ` [PATCH 1/2] Rename tui-stack -> tui-status Tom Tromey
@ 2023-12-13 13:35   ` Alexandra Petlanova Hajkova
  2023-12-13 20:00     ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandra Petlanova Hajkova @ 2023-12-13 13:35 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

On Fri, Dec 8, 2023 at 6:43 PM Tom Tromey <tom@tromey.com> wrote:

> The TUI status line is called the "status" window in the
> documentation, but not in the source.  There, the relevant files are
> named "tui-stack", which to me makes it sound like they have something
> to do with backtraces.  This patch renames them to "tui-status".
>
>
Hi,

this patch does not compile for me with:
./../binutils-gdb/gdb/tui/tui-data.c:29:10: fatal error: tui/tui-stack.h:
No such file or directory
   29 | #include "tui/tui-stack.h"
      |          ^~~~~~~~~~~~~~~~~

Have you forgotten to modify tui-data.c?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Rename tui-stack -> tui-status
  2023-12-13 13:35   ` Alexandra Petlanova Hajkova
@ 2023-12-13 20:00     ` Tom Tromey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2023-12-13 20:00 UTC (permalink / raw)
  To: Alexandra Petlanova Hajkova; +Cc: Tom Tromey, gdb-patches

>>>>> "Alexandra" == Alexandra Petlanova Hajkova <ahajkova@redhat.com> writes:

Alexandra> this patch does not compile for me with:
Alexandra> ./../binutils-gdb/gdb/tui/tui-data.c:29:10: fatal error: tui/tui-stack.h: No such file or directory
Alexandra>    29 | #include "tui/tui-stack.h"
Alexandra>       |          ^~~~~~~~~~~~~~~~~

Alexandra> Have you forgotten to modify tui-data.c?

I think that a patch adding this inclusion landed after I sent my patch.
I will update and send v2 shortly.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-13 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 17:43 [PATCH 0/2] Rename TUI status code to follow the docs Tom Tromey
2023-12-08 17:43 ` [PATCH 1/2] Rename tui-stack -> tui-status Tom Tromey
2023-12-13 13:35   ` Alexandra Petlanova Hajkova
2023-12-13 20:00     ` Tom Tromey
2023-12-08 17:43 ` [PATCH 2/2] Rename TUI locator window -> status 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).