Bug 30502 - [gdb/tui] output window
Summary: [gdb/tui] output window
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: tui (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 23:35 UTC by Tom de Vries
Modified: 2023-06-01 09:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
WIP patch (2.65 KB, patch)
2023-05-31 23:35 UTC, Tom de Vries
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2023-05-31 23:35:58 UTC
Created attachment 14910 [details]
WIP patch

I've written a WIP patch on top of https://sourceware.org/pipermail/gdb-patches/2023-May/199917.html .

The rough idea is as follows.  We add an output window, so we have:
...
┌─hello.c───────────────────────────────────────────────────┐
│       12   printf ("hello10\n");                          │
│  >    13   printf ("hello11\n");                          │
│       14   printf ("hello12\n");                          │
│       15   printf ("hello13\n");                          │
│       16   printf ("hello14\n");                          │
└───────────────────────────────────────────────────────────┘
native process 877 In: main               L13   PC: 0x40056f 
Temporary breakpoint 1, main () at hello.c:3
(gdb) n
(gdb) 
hello8
hello9
hello10

...

That is, from top to bottom:
- src window
- status window
- cmd window
- output window
...

This fixes the problem that:
...
(gdb) next
...
followed by <enter> produces very briefly:
...
(gdb) next
hello
...
before being overwritten by the following prompt:
...
(gdb) next
(gdb) 
...
Comment 1 Andrew Burgess 2023-06-01 09:43:08 UTC
Adding this link just so there's a record.  Pedro made a start on having the inferior always write into a pseudo tty in this series:

https://inbox.sourceware.org/gdb-patches/20210614212410.1612666-1-pedro@palves.net/

This doesn't try to address the TUI overwrite problem, but in theory should be the basis for allowing GDB to keep the inferior output and TUI prompts in the same window while avoiding the overwrite issue.

That said having the option of a separate output window would be a nice choice, but I think it should be a choice.