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