From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic303-21.consmr.mail.ir2.yahoo.com (sonic303-21.consmr.mail.ir2.yahoo.com [77.238.178.202]) by sourceware.org (Postfix) with ESMTPS id 3D8CE3851C0A for ; Mon, 8 Jun 2020 19:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3D8CE3851C0A X-YMail-OSG: 51cwPvAVM1l9Z2sh_3y2obFeuu7Z64Jo09lFvILA4kvGw0nUxaiZ0tntInM9ky5 GcFxpVgxntf4DvJBJs56PHORgnMJqlJEal4qjjRaNNWUAWwI14F93Of7HZ94D_Pwrz7v8KcJ9gzD Z0Kfb.pR2XQNlhUvlXoel6VVrbldOh5QWjmnv6TuQxMh.rhSDLp2DaBljH.VmfDoolOMCCyvX6.o 5RDmG6S1ekXpu0DaMPUidFa889GQ2f3upaNS5_g7HMbMx_csAa9xmvhgrY5bDb1LRAG6O80D4XZy BDZLyo4WEUf2wSZGagY3EclEaEV2FyeHrJbF8CFP0q0JFxsR8s0wjS8zL8dgcNTNTP1uvUpoHOvj ferGP9Ga1S447rMiHtqzn1_XV68LfSy6L9RWVbBhPNeNLtl_MDdq.nLYEYNdhEWjEJeGEoBLAErs zbxg3VHW778ag9jjKRtNbOu_.jTG7VAJCr6OPCuWY56DkZAsq99BcMqv_.NETtXd1BPACPCS.BTG Rk6_OIsTLeVKw0wHv4Vs8.dmADlsnRV2pREuHrzyZTNYYtm_yi0BHvskZ1p5RLfViYkSAC43uJp3 Tj9OheDw.ph86roBKKdCPy6vm3q_dXPkJlgWXsy6ommq.HpvUvyMeFjrtpeWp0P9d_hiSmrwR35B eSdx12Q..4PeyzdY4KARHtJRTrN9fygciUPnrr1emQ.o5zh2KUsWD7vUhK.i5xULpSpJxcgZMGLs kDop8hwox2xxJmvq.tKwNQa91aGJp8otxCZ8H0bWFy7Qovcd1huBZzd4srNa8gaXhfonT9M9B2M4 s22PyT7UQLN697yaIasa36pOXhjfCsfh9Rmgi0FTF4Q554kCKWfA9Q6imGZVR_2iupVHR61Mjhbg mQin8VqKzI0U55hpM2kUhwAS_R9UYERsGuggtwR2mQ42tCK2OljtCVm68FYnFLTyuRzQTqDXjjq7 W4JY2pofnf1ndvjyNdCL2eXbA3ZiVWGl9.XD08ltLOnXBjKwkGzQ9VHgHXZHNh_PslStd2herhU4 AjZYNSpwqJONqLaOGKfxlxVIRQ4P.ccY2Xij7y2RMoMvo90DseUaKScLyZ50sNtlpp09RiFeWgFn UeJo99Sonw7f2Oyr3LtXqOw1tKRRYxuxeRs0fBDGIOtyOFBtwWTWdQ9RoAKDmMqQ1HYA75IEh666 LoOGy5h568vb2DM9wHQRFA2_Pw.xtY0VQvIv6cTXA_5oHb69FKLjPEUP8zShwcK_iiuoHRH3YhIk LAB5kjKZO5Hm733V6PIP3lR6RboH20X_cRyBT.c.mSK513AtaROwRgTEaZ9tAdJJaNH0bsuXq5ag CMoUTf5qjXwOXoL7FG743ddhZQjWCm5YgVaMfEms- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Mon, 8 Jun 2020 19:45:56 +0000 Date: Mon, 8 Jun 2020 19:45:52 +0000 (UTC) From: Hannes Domani To: Andrew Burgess Cc: Gdb-patches Message-ID: <1596087952.2154785.1591645552465@mail.yahoo.com> In-Reply-To: <361311042.2032406.1591637815686@mail.yahoo.com> References: <509346577.1585683.1591617067795.ref@mail.yahoo.com> <509346577.1585683.1591617067795@mail.yahoo.com> <20200608144112.GA2737@embecosm.com> <1606516834.1835332.1591628330375@mail.yahoo.com> <20200608153504.GB2737@embecosm.com> <361311042.2032406.1591637815686@mail.yahoo.com> Subject: Re: [PING^2][PATCH][PR gdb/21690] Fix interruption of command history search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.16072 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 19:45:58 -0000 Am Montag, 8. Juni 2020, 19:37:05 MESZ hat Hannes Domani via Gdb-patches <= gdb-patches@sourceware.org> Folgendes geschrieben: > Am Montag, 8. Juni 2020, 17:36:09 MESZ hat Andrew Burgess Folgendes geschrieben: > > > * Hannes Domani [2020-06-08 14:58:50 +0000]: > > > > >=C2=A0 Am Montag, 8. Juni 2020, 16:41:32 MESZ hat Andrew Burgess Folgendes geschrieben: > > > > > > > * Hannes Domani via Gdb-patches [2020-= 06-08 11:51:07 +0000]: > > > > > > > > > Ping. > > > > > > > > > > Am Freitag, 15. Mai 2020, 11:00:41 MESZ hat Hannes Domani via Gdb= -patches Folgendes geschrieben: > > > > > > > > > > > Am Samstag, 25. April 2020, 19:17:34 MESZ hat Hannes Domani via= Gdb-patches Folgendes geschrieben: > > > > > > > > > > > > Ping. > > > > > > > > > > > > > If you press Ctrl-C during an incremental search of the readl= ine history, the > > > > > > > prompt is reset, but readline is still in the incremental sea= rch mode. > > > > > > > > > > > > > > The call of rl_callback_sigcleanup cleans up the internal rea= dline state, and > > > > > > > disables the incremental search mode. > > > > > > > > I didn't look into the implementation of this, but something seems = a > > > > little odd, though I don't know if this is just my machine setup...= . > > > > > > > > I start a GDB session, and do this: > > > > > > > >=C2=A0=C2=A0 (gdb) echo hello\n > > > >=C2=A0=C2=A0 hello > > > > > > > > At this point I start a reverse search, so I type: > > > > > > > >=C2=A0=C2=A0 > > > >=C2=A0=C2=A0 echo > > > >=C2=A0=C2=A0 > > > > > > > > Now I'm left in this situation: > > > > > > > >=C2=A0=C2=A0 (gdb) echo hello\n > > > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > > > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '-- Prompt is here. > > > > > > > > So, whatever I was in the process of finding when I hit Ctrl+C is l= eft > > > > on my prompt line in an editable state. > > > > > > > > This is different from the behaviour I see in, for example, bash, > > > > where when I Ctrl+C the reverse search is aborted and I'm dropped b= ack > > > > to an empty prompt. > > > > > > > > Which behaviour do you see? > > > > > > This is the behaviour I also see with this patch applied. > > > > > > > > > > Which behaviour do you expect to see? > > > > > > I didn't compare with anything else, so my expectation was just that = it > > > shouldn't be in this weird state where the prompt is empty, but readl= ine > > > actually thinks it's still in the reverse search. > > > > I think we should end up back at the empty prompt.=C2=A0 That certainly > > feels more natural after a Ctrl+C (to me anyway). > > I tried to implement that, and the best source I could find was this: > https://lists.gnu.org/archive/html/bug-readline/2016-04/msg00071.html > > But I could not figure out a way that also works in TUI mode. > > How does it work that the line is cleared when not in the reverse-search = mode? I figured that part out, the line is cleared by one of the observers: gdb::observers::command_error.notify (); So I moved rl_callback_sigcleanup in front of it, and the line is cleared (kinda), but only after the current line is displayed, so now I get 2 promp= ts on top of each other: (reverse-i-search)`a': echo Quitn (gdb) echo (gdb) At this point I stopped for the day. Hannes