From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 53A5D3851C05 for ; Mon, 8 Jun 2020 14:41:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 53A5D3851C05 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x429.google.com with SMTP id l10so17664905wrr.10 for ; Mon, 08 Jun 2020 07:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=LhU8HmyXOvZWsZmGhslyflkIfsv7vYMqG+jNiwWF4uY=; b=P4wwvk/k0/NUr2Or6vZjjtUIP7RCJFOXQwbfKKKFkBzAftHkq/NP3wjn3BDcikA9kZ zrcy2KdP6iOyKntun+d38dOmw0Qk2IcXpCyUlwNGRcv6zrwy5jKIFeYFQAuAXY5vKmSt E/sEGtGxRRpeojA0ELpVBpLgWtBEU8IhtFqd3+o+wqJYIgIMHoJp4xajIDMqnT7lIlq7 OynYXEQDv6yzMxWJ27BrwyfYZizGxDOZymf6HaB2vudcAJ/W172DuFabpzpvGUm/rBc+ +rIeY+gRRmjZzpBEZmCzYz3NTa4V0cuE6g0rAxN27okofvPrD+eVfwm0oqwFWIPHyHUu fDDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=LhU8HmyXOvZWsZmGhslyflkIfsv7vYMqG+jNiwWF4uY=; b=kDvD8ssM8qXZ6MeE9TK61exVuRnJTy7Y5+8FtuA5B8f6cmd2TLNJIRDC0UHhzHc8y2 3iy8fNimdroHZylwmwdvkouAnnA/OiRDck8rD7iGHtF43W11u2S+QLZjwba5WziXZ+bZ wsA3Lx02w18RkRzeSWAN0Mnzg6DcM+nhOkFvZX70zLW7BcL/AGbUmnb3+i6T2Sniu+kJ h9g4BZyxdTCMG/lktD/32pqU5mvYrRztjxAKimhx3OdrdWvLR2FQWiRVqfreC4YWtZ9b OQcbKgOh41tS7B7dnytXTq6tr8tebuU8PJjXw5cBP0OlkhhYHt5MBDpQZOuu+YeeqWuO ytWg== X-Gm-Message-State: AOAM531Xvb+r2+5MTSRKox0VHbRF1u3CdrD/Gp/C0C1WXOv67qc9VZpv kHowV0pFf+PSYCRSpc5I7QCauROQX8M= X-Google-Smtp-Source: ABdhPJzjfQk5gz2s5L8SzooocQVO6MaNIry00dzMyg2sNBWUcqGRjKciJrX+RytvD2EjBbFZ1/kwCQ== X-Received: by 2002:adf:e588:: with SMTP id l8mr25579533wrm.255.1591627274317; Mon, 08 Jun 2020 07:41:14 -0700 (PDT) Received: from localhost (host86-128-12-16.range86-128.btcentralplus.com. [86.128.12.16]) by smtp.gmail.com with ESMTPSA id h12sm22987113wro.80.2020.06.08.07.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 07:41:13 -0700 (PDT) Date: Mon, 8 Jun 2020 15:41:12 +0100 From: Andrew Burgess To: Hannes Domani Cc: Gdb-patches Subject: Re: [PING^2][PATCH][PR gdb/21690] Fix interruption of command history search Message-ID: <20200608144112.GA2737@embecosm.com> References: <509346577.1585683.1591617067795.ref@mail.yahoo.com> <509346577.1585683.1591617067795@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <509346577.1585683.1591617067795@mail.yahoo.com> X-Operating-System: Linux/5.6.15-200.fc31.x86_64 (x86_64) X-Uptime: 15:36:04 up 4:43, 1 X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, 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 14:41:16 -0000 * Hannes Domani via Gdb-patches [2020-06-08 11= :51:07 +0000]: > Ping. >=20 > Am Freitag, 15. Mai 2020, 11:00:41 MESZ hat Hannes Domani via Gdb-patches= Folgendes geschrieben: >=20 > > Am Samstag, 25. April 2020, 19:17:34 MESZ hat Hannes Domani via Gdb-pat= ches Folgendes geschrieben: > > > > Ping. > > > > > If you press Ctrl-C during an incremental search of the readline hist= ory, the > > > prompt is reset, but readline is still in the incremental search mode. > > > > > > The call of rl_callback_sigcleanup cleans up the internal readline st= ate, 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: (gdb) echo hello\n hello At this point I start a reverse search, so I type: echo Now I'm left in this situation: (gdb) echo hello\n ^ '-- Prompt is here. So, whatever I was in the process of finding when I hit Ctrl+C is left 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 back to an empty prompt. Which behaviour do you see? Which behaviour do you expect to see? Thanks, Andrew > > > > > > gdb/ChangeLog: > > > > > > 2020-04-25=A0 Hannes Domani=A0 > > > > > >=A0=A0=A0=A0 PR gdb/21690 > > >=A0=A0=A0=A0 * main.c (start_event_loop): Call rl_callback_sigcleanup. > > > --- > > > gdb/main.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/gdb/main.c b/gdb/main.c > > > index 59cb14161b..a8c1d3ccb1 100644 > > > --- a/gdb/main.c > > > +++ b/gdb/main.c > > > @@ -55,6 +55,8 @@ > > > #include "gdbsupport/alt-stack.h" > > > #include "observable.h" > > > > > > +#include "readline/readline.h" > > > + > > > /* The selected interpreter.=A0 This will be used as a set command > > >=A0=A0=A0=A0 variable, so it should always be malloc'ed - since > > >=A0=A0=A0=A0 do_setshow_command will free it.=A0 */ > > > @@ -371,6 +373,8 @@ start_event_loop () > > >=A0=A0=A0=A0=A0=A0=A0=A0 in a messed-up state.=A0 Reset it here.=A0 */ > > >=A0=A0=A0=A0=A0=A0 current_ui->prompt_state =3D PROMPT_NEEDED; > > >=A0=A0=A0=A0=A0=A0 gdb::observers::command_error.notify (); > > > +=A0=A0=A0=A0=A0 /* Clean up internal state of the callback interface= =2E=A0 */ > > > +=A0=A0=A0=A0=A0 rl_callback_sigcleanup (); > > >=A0=A0=A0=A0=A0=A0 /* This call looks bizarre, but it is required.=A0 = If the user > > >=A0=A0=A0=A0=A0=A0=A0=A0 entered a command that caused an error, > > >=A0=A0=A0=A0=A0=A0=A0=A0 after_char_processing_hook won't be called fr= om > > > -- > > > 2.26.2