From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D2503858C52; Fri, 14 Jul 2023 11:23:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D2503858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689333801; bh=QbJp/5vDxc9f1nZbi8zY3cC02HNF2iGpnfsLDw/Q96I=; h=From:To:Subject:Date:From; b=RR7J55QMQrRahsFNOphOwHSwsoP3po3Zi/nTc64Zlhe5nyBwdkRvAjP4rwulnROgP FC2lTsHdZGX4r+ZoDYqj8llCu8pCOPQIRoqUf2zkr7Esmp2O0p/Tou9hlVBUWYXyXR y/ZP+bEmcl69qistNfAa+FLIiJHXT/vDZ8N9ssaw= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tui/30636] New: [gdb/tui] Secondary prompt overwritten Date: Fri, 14 Jul 2023 11:23:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tui X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30636 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)=20 ... Now let's try the same in TUI: ... (gdb) define foo=20=20=20 Type commands for definition of "foo". End with a line saying just "end". (gdb) show user User command "foo": bar (gdb)=20 ... The secondary prompt lines are not terminated with a \n, and are consequent= ly 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 &&line) saved_after_char_processing_hook =3D after_char_processing_hook; after_char_processing_hook =3D 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)=20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=