From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 69BCB3858D3C for ; Tue, 17 May 2022 11:41:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69BCB3858D3C Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0B3641E143; Tue, 17 May 2022 07:41:06 -0400 (EDT) Message-ID: Date: Tue, 17 May 2022 07:41:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 5/5] Make gdb_test's question non-optional if specified Content-Language: en-US To: Pedro Alves , gdb-patches@sourceware.org References: <20220330192929.3161015-1-pedro@palves.net> <20220330192929.3161015-6-pedro@palves.net> From: Simon Marchi In-Reply-To: <20220330192929.3161015-6-pedro@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Tue, 17 May 2022 11:41:08 -0000 On 2022-03-30 15:29, Pedro Alves wrote: > gdb_test supports handling scenarios where GDB asks a question before > finishing handling some command. The full prototype of gdb_test is: > > # gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE > > However, QUESTION is a question that GDB _may_ ask, not one that GDB > _must_ ask: > > # QUESTION is a question GDB may ask in response to COMMAND, like > # "are you sure?" > # RESPONSE is the response to send if QUESTION appears. > > If GDB doesn't raise the question, the test still passes. > > I think that this is a misfeature. If GDB regresses and stops asking > a question, the testsuite won't notice. So I think that if a QUESTION > is specified, gdb_test should ensure it comes out of GDB. > > Running the testsuite exposed a number of tests that pass > QUESTION/RESPONSE to GDB, but no question comes out. The previous > commits fixed them all, so this commit changes gdb_test's behavior. > > A related issue is that gdb_test doesn't enforce that if you specify > QUESTION, that you also specify RESPONSE. I.e., you should pass 1, 2, > 3, or 5 arguments to gdb_test, but never 4, or more than 5. Making > gdb_test detect bogus arguments actually regressed some testcases, > also all fixed in previous commits. > > Change-Id: I47c39c9034e6a6841129312037a5ca4c5811f0db Hi Pedro, I see this failure starting with this patch: $ make check TESTS="gdb.python/py-connection.exp" RUNTESTFLAGS="--target_board=native-gdbserver" (gdb) PASS: gdb.python/py-connection.exp: info connections while the connection is still around disconnect^M Ending remote debugging.^M (gdb) FAIL: gdb.python/py-connection.exp: kill the inferior Simon