From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54472 invoked by alias); 25 Mar 2018 17:13:50 -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 53821 invoked by uid 89); 25 Mar 2018 17:13:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=yours X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Mar 2018 17:13:48 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D42FC4040074; Sun, 25 Mar 2018 17:13:46 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49666D7DE7; Sun, 25 Mar 2018 17:13:46 +0000 (UTC) Subject: Re: [RFA v3 07/13] Throw a "quit" on a KeyboardException in py-framefilter.c To: Tom Tromey References: <20180323205512.14434-1-tom@tromey.com> <20180323205512.14434-8-tom@tromey.com> <43b0c215-f754-a4e5-d39d-9d9e5ed30990@redhat.com> <87po3saz6r.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Sun, 25 Mar 2018 17:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <87po3saz6r.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00503.txt.bz2 On 03/25/2018 05:37 PM, Tom Tromey wrote: > Pedro> Or, are we leaving a gdb prompt in the expect buffer unprocessed? > > I don't think so but I guess I am not really sure. We are then, since there's a prompt after the Quit that your gdb_test_multiple is not consuming. That is a recipe for making the following gdb_test/gdb_test_multiple confused and hit the internal default prompt/FAIL match in gdb_test_multiple: ... -re "\r\n$gdb_prompt $" { if ![string match "" $message] then { fail "$message" } set result 1 } ... Given the "$", it's going to be racy, though make check-read1 is more likely to catch it. Sounds like that doesn't happen currently because your test is the last one before restarting gdb. So if you add more tests after yours, it's likely you'll see a problem. Or even without more tests, it can still happen with board files that issue gdb commands when tearing down the connection or gdb. So you need to consume the prompt, like: gdb_test_multiple "bt 1" $test { - -re "Quit" { + -re "Quit\r\n$gdb_prompt $" { pass $test } } Or simply instead: gdb_test "bt 1" "Quit" "bt 1 with KeyboardInterrupt" since gdb_test adds the prompt to the expected string for you. Thanks, Pedro Alves