public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tui/30636] New: [gdb/tui] Secondary prompt overwritten
@ 2023-07-14 11:23 vries at gcc dot gnu.org
  2023-07-14 12:47 ` [Bug tui/30636] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-07-14 11:23 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30636
           Summary: [gdb/tui] Secondary prompt overwritten
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider this gdb session:
...
$ gdb -q
(gdb) define foo
Type commands for definition of "foo".
End with a line saying just "end".
>bar
>end
(gdb) show user
User command "foo":
  bar

(gdb) 
...

Now let's try the same in TUI:
...
(gdb) define foo   
Type commands for definition of "foo".
End with a line saying just "end".
(gdb) show user
User command "foo":
  bar

(gdb) 
...

The secondary prompt lines are not terminated with a \n, and are consequently
overwritten.

With this tentative patch:
...
diff --git a/gdb/top.c b/gdb/top.c
index 90ddc5f5ea7..f9b967c5c64 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -77,6 +77,7 @@

 #if defined(TUI)
 # include "tui/tui.h"
+# include "tui/tui-io.h"
 #endif

 #ifndef O_NOCTTY
@@ -958,6 +959,9 @@ gdb_readline_wrapper_line (gdb::unique_xmalloc_ptr<char>
&&line)
   saved_after_char_processing_hook = after_char_processing_hook;
   after_char_processing_hook = NULL;

+  if (tui_active)
+    tui_inject_newline_into_command_window ();
+
   /* Prevent parts of the prompt from being redisplayed if annotations
      are enabled, and readline's state getting out of sync.  We'll
      reinstall the callback handler, which puts the terminal in raw
...
we get instead:
...
(gdb) define foo
Type commands for definition of "foo".
End with a line saying just "end".
>bar
>end
(gdb) show user
User command "foo":
  bar

(gdb) 
...

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

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

end of thread, other threads:[~2023-07-26 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 11:23 [Bug tui/30636] New: [gdb/tui] Secondary prompt overwritten vries at gcc dot gnu.org
2023-07-14 12:47 ` [Bug tui/30636] " vries at gcc dot gnu.org
2023-07-26 11:32 ` cvs-commit at gcc dot gnu.org
2023-07-26 11:33 ` vries at gcc dot gnu.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).