public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tui/28600] New: "layout reg" nor "kill" refresh the TUI registers window
@ 2021-11-17 19:17 pedro at palves dot net
  2023-11-24 10:28 ` [Bug tui/28600] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pedro at palves dot net @ 2021-11-17 19:17 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28600

            Bug ID: 28600
           Summary: "layout reg" nor "kill" refresh the TUI registers
                    window
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: pedro at palves dot net
  Target Milestone: ---

If you run to main in CLI mode, and then issue 'layout reg', the register
window shows:

  "[ Register Values Unavailable ]"

... even though the process is live and we have a frame selected.

If you step/stepi/next, etc. at this point, then the registers window refreshes
itself and shows registers.

In the "step" case, we show registers because we get here:

 (top-gdb) bt
 #0 tui_data_window::show_registers (this=0x5555590decf0, group=0x0) at 
 ../../src/gdb/tui/tui-regs.c:183
 #1 0x0000555555d22bfd in tui_data_window::check_register_values
(this=0x5555590decf0, frame=0x555558d59450) at ../../src/gdb/tui/tui-regs.c:468
 #2 0x0000555555d07aa0 in tui_refresh_frame_and_register_information () at
../../src/gdb/tui/tui-hooks.c:143
 #3 0x0000555555d07b9b in tui_before_prompt (current_gdb_prompt=0x5555564e3af0
<top_prompt+16> "(top-gdb) ") at ../../src/gdb/tui/tui-hooks.c:185


In the "layout reg" case, we get to tui_refresh_frame_and_register_information
as well, but hit the early return:

 /* Refresh TUI's frame and register information.  This is a hook intended to
be
    used to update the screen after potential frame and register changes.  */

 static void
 tui_refresh_frame_and_register_information ()
 {
   if (!from_stack && !from_source_symtab)
     return;


These two "from_stack" and "from_source_symtab" globals are set by the
tui_normal_stop, tui_context_changed, tui_symtab_changed observers, AFAICT.

So any state change refreshes the TUI registers, but doing "layout reg" does
not as it doesn't cause these observers to be called.

I also noticed that if you're in "layout reg", and the register window is
showing something, and then do "kill", the process is now gone but the register
window continues showing the values of the registers from before the kill.
Off-hand, I'd think "kill" should have resulted in the tui_context_changed
observer being called.  I didn't try it, but I'd get "detach", "disconnect" and
perhaps other commands have the same issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-02-08 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 19:17 [Bug tui/28600] New: "layout reg" nor "kill" refresh the TUI registers window pedro at palves dot net
2023-11-24 10:28 ` [Bug tui/28600] " vries at gcc dot gnu.org
2023-12-16  8:31 ` cvs-commit at gcc dot gnu.org
2023-12-16  8:37 ` vries at gcc dot gnu.org
2023-12-17 19:37 ` tromey at sourceware dot org
2024-02-08 19:34 ` cvs-commit at gcc dot gnu.org
2024-02-08 19:36 ` tromey at sourceware dot org

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).