From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24630 invoked by alias); 18 Oct 2016 16:09:05 -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 24615 invoked by uid 89); 18 Oct 2016 16:09:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1356, Got, Expecting, Kill X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Oct 2016 16:09:02 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1bwWwm-0006dG-Ii from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Tue, 18 Oct 2016 09:09:00 -0700 Received: from [134.86.127.136] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 18 Oct 2016 09:08:58 -0700 Subject: Re: [patch, rfa] tweak to defaulted_query logic to fix gdb.mi test errors References: <57CF117B.5040106@codesourcery.com> To: Sandra Loosemore , Reply-To: Luis Machado From: Luis Machado Message-ID: <89d464fc-3c9c-8532-6f29-77b9e7c383dd@codesourcery.com> Date: Tue, 18 Oct 2016 16:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <57CF117B.5040106@codesourcery.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00515.txt.bz2 On 09/06/2016 01:56 PM, Sandra Loosemore wrote: > This patch moves the check for deprecated_query_hook before > input-not-from-terminal check in defaulted_query, instead of after it. > Presently, the only thing that uses deprecated_query_hook is the MI > backend, which uses it to suppress the question entirely, so that the > current behavior leads to the situation where nothing is printed when > the input is a terminal but there is a message otherwise, which is > somewhat odd. > > The specific problem this patch solves is a testing issue with > gdbserver. mi_gdb_target_load says: > > mi_gdb_test "kill" ".*" "" > > and if the test harness is not running GDB from a terminal we get: > > Expecting: ^(kill[ > ]+)?(.*[ > ]+[(]gdb[)] > [ ]*) > kill > &"kill\n" > ~"Kill the program being debugged? (y or n) [answered Y; input not from > terminal]\n" > ERROR: Got interactive prompt. > > because it is tripping over the "\\(y or n\\) " pattern in mi_gdb_test. > Of course mi_gdb_test could be fixed to recognize the "input not from > terminal" message as valid, but I don't think that's the intended MI > behavior. I think this is a bug in GDB, not the testsuite. > > OK to commit? > > -Sandra > This looks simple and reasonable enough for me. What do others/maintainers think?