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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  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 ` vries at gcc dot gnu.org
  2023-12-16  8:31 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2023-11-24 10:28 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Pedro Alves from comment #0)
> 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.
> 

https://sourceware.org/pipermail/gdb-patches/2023-November/204464.html

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

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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-16  8:31 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=86a6f9a9fb112614c15cc17630b29fbc62d3bca5

commit 86a6f9a9fb112614c15cc17630b29fbc62d3bca5
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Dec 16 09:31:29 2023 +0100

    [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

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

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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2023-12-16  8:37 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Sourceware Commits from comment #2)

>     [gdb/tui] Show regs when switching to regs layout

This doesn't change the behaviour when killing, so the bug is not completely
fixed yet.

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

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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  2021-11-17 19:17 [Bug tui/28600] New: "layout reg" nor "kill" refresh the TUI registers window pedro at palves dot net
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2023-12-17 19:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I have a fix.

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

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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  2021-11-17 19:17 [Bug tui/28600] New: "layout reg" nor "kill" refresh the TUI registers window pedro at palves dot net
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-08 19:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=66ab1a14e196a5ad1f5fd8d225647bd48ff02a25

commit 66ab1a14e196a5ad1f5fd8d225647bd48ff02a25
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Dec 17 12:38:15 2023 -0700

    Update TUI register window when the inferior exits

    When the inferior exits, the TUI register window should clear.

    Fixing this was mostly a matter of sticking an assignment into
    tui_inferior_exit.  However, some changes to the register window
    itself were also needed.

    While working on this, I realized that the TUI register window would
    not work correctly when moving between frames of different
    architectures.  This patch attempts to fix this as well, though I have
    no way to test it.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28600
    Tested-By: Tom de Vries <tdevries@suse.de>
    Reviewed-By: Andrew Burgess <aburgess@redhat.com>
    Approved-By: Andrew Burgess <aburgess@redhat.com>

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

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

* [Bug tui/28600] "layout reg" nor "kill" refresh the TUI registers window
  2021-11-17 19:17 [Bug tui/28600] New: "layout reg" nor "kill" refresh the TUI registers window pedro at palves dot net
                   ` (4 preceding siblings ...)
  2024-02-08 19:34 ` cvs-commit at gcc dot gnu.org
@ 2024-02-08 19:36 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2024-02-08 19:36 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |15.1

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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