From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65279 invoked by alias); 10 Feb 2017 18:36:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 65266 invoked by uid 89); 10 Feb 2017 18:36:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1605, H*i:sk:0d8bd42, H*MI:sk:0d8bd42, H*f:sk:0d8bd42 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Feb 2017 18:36:26 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 191D7C04B94C; Fri, 10 Feb 2017 18:36:26 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1AIaNrL014894; Fri, 10 Feb 2017 13:36:23 -0500 Subject: Re: [PATCH] Don't send queries to the MI interpreter To: Simon Marchi References: <20170210163650.10334-1-simon.marchi@ericsson.com> <89904751-7015-b272-98c1-33e786f7c356@redhat.com> <85ae4ad9-acdc-c9ba-6606-a7ac2abc7e2e@redhat.com> <0d8bd42f-5964-1ac7-414a-754540db2e95@redhat.com> Cc: Simon Marchi , gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 10 Feb 2017 18:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <0d8bd42f-5964-1ac7-414a-754540db2e95@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00270.txt.bz2 On 02/10/2017 06:07 PM, Pedro Alves wrote: > On 02/10/2017 05:44 PM, Pedro Alves wrote: > >> OK, I found the branch. Pushed here now: >> >> https://github.com/palves/gdb/commits/palves/console-pagination > > And re-reading the branch again, I noticed this hunk: > > @@ -1255,7 +1258,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) > way, important error messages don't get lost when talking to GDB > over a pipe. */ > if (current_ui->instream != current_ui->stdin_stream > - || !input_interactive_p (current_ui)) > + || !input_interactive_p (current_ui) > + /* We can't handle nested queries. */ > + || current_ui != main_ui) > { > old_chain = make_cleanup_restore_target_terminal (); > > @@ -2045,36 +2050,48 @@ begin_line (void) > } > } > > This is similar to your patch, but it handles something your > version doesn't, I think. That is the case of handling the secondary > channel being a CLI interpreter, not an MI one, and that UI > having been started on a terminal. So with with all the rationale I've thrown out, and idea that we shouldn't see a query anyway, and considering that real MI commands shouldn't really query anyway (nobody sees the query output), it may be actually impossible to find a way to this with MI on the secondary channel, that will remain stable going forward. Hmm. So how about using the hunk shown above, which should handle your case as well, and while at it write a test that uses CLI in the secondary UI instead, making sure a query is auto-answered in that UI? Thanks, Pedro Alves