aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-12-16 09:31:29 +0100
committerTom de Vries <tdevries@suse.de>2023-12-16 09:31:29 +0100
commit86a6f9a9fb112614c15cc17630b29fbc62d3bca5 (patch)
tree49bacf6cc5769d282d3240711ec9b4259ca58dd1 /gdb/tui
parentbebb0dd44b98f5b6555cb75389b7b14deed9550e (diff)
downloadgdb-86a6f9a9fb112614c15cc17630b29fbc62d3bca5.zip
gdb-86a6f9a9fb112614c15cc17630b29fbc62d3bca5.tar.gz
gdb-86a6f9a9fb112614c15cc17630b29fbc62d3bca5.tar.bz2
[gdb/tui] Show regs when switching to regs layout
When starting gdb in CLI mode, running to main and switching into the TUI regs layout: ... $ gdb -q a.out -ex start -ex "layout regs" ... we get: ... +---------------------------------+ | | | [ Register Values Unavailable ] | | | +---------------------------------+ ... Fix this by handling this case in tui_data_window::rerender. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR tui/28600 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28600
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-regs.c14
-rw-r--r--gdb/tui/tui-regs.h6
2 files changed, 16 insertions, 4 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index ba801dd..4ed3a2e 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -192,7 +192,7 @@ tui_data_window::show_registers (const reggroup *group)
m_regs_content.clear ();
}
- rerender ();
+ rerender (false);
}
@@ -415,10 +415,18 @@ tui_data_window::erase_data_content (const char *prompt)
/* See tui-regs.h. */
void
-tui_data_window::rerender ()
+tui_data_window::rerender (bool toplevel)
{
if (m_regs_content.empty ())
- erase_data_content (_("[ Register Values Unavailable ]"));
+ {
+ if (toplevel && has_stack_frames ())
+ {
+ frame_info_ptr fi = get_selected_frame (NULL);
+ check_register_values (fi);
+ }
+ else
+ erase_data_content (_("[ Register Values Unavailable ]"));
+ }
else
{
erase_data_content (NULL);
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 5adff63..1abd22c 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -75,7 +75,11 @@ protected:
{
}
- void rerender () override;
+ void rerender (bool toplevel);
+ void rerender () override
+ {
+ rerender (true);
+ }
private: