From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8943 invoked by alias); 29 May 2013 10:08:48 -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 8931 invoked by uid 89); 29 May 2013 10:08:48 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-bk0-f42.google.com (HELO mail-bk0-f42.google.com) (209.85.214.42) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 29 May 2013 10:08:47 +0000 Received: by mail-bk0-f42.google.com with SMTP id jk13so4817174bkc.15 for ; Wed, 29 May 2013 03:08:45 -0700 (PDT) X-Received: by 10.205.13.194 with SMTP id pn2mr574627bkb.76.1369822124909; Wed, 29 May 2013 03:08:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.185.203 with HTTP; Wed, 29 May 2013 03:08:04 -0700 (PDT) In-Reply-To: <51A4263B.1060707@codesourcery.com> References: <1361192891-29341-1-git-send-email-yao@codesourcery.com> <8738wpd3qe.fsf@fleche.redhat.com> <5176C14B.6010603@redhat.com> <51774714.9060306@codesourcery.com> <51969A92.80003@redhat.com> <519CBE2B.7060007@redhat.com> <51A4263B.1060707@codesourcery.com> From: Hui Zhu Date: Wed, 29 May 2013 10:08:00 -0000 Message-ID: Subject: Re: [RFC] PR 15075 dprintf interferes with "next" To: Yao Qi Cc: Pedro Alves , Tom Tromey , gdb-patches@sourceware.org, Keith Seitz Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-05/txt/msg00989.txt.bz2 On Tue, May 28, 2013 at 11:36 AM, Yao Qi wrote: > On 05/28/2013 08:01 AM, Hui Zhu wrote: >>>> >>>> +gdb_test_multiple $test $test { >>>> >>+ -re "interrupt\r\n$gdb_prompt " { >>>> >>+ pass $test >>>> >>+ } >>>> >>+} >>>> >>+ >>>> >>+set test "inferior stopped" >>>> >>+gdb_test_multiple "" $test { >>>> >>+ -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" { >>>> >>+ pass $test >>>> >>+ } >>>> >>+} >>> >>> > >>> >This leaves the prompt in the expect buffer. I think >>> >this is likely to confuse the following test that runs. >>> > >> >> After change this part to: >> gdb_test_multiple "" $test { >> -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n$gdb_prompt" { >> pass $test >> } >> } >> I got: >> Running ../../../src/gdb/testsuite/gdb.base/dprintf-non-stop.exp ... >> FAIL: gdb.base/dprintf-non-stop.exp: inferior stopped (timeout) >> > > because the gdb_prompt has been consumed by the previous matching: > > gdb_test_multiple $test $test { > -re "interrupt\r\n$gdb_prompt " { > ^^^^^^^^^^^^ > pass $test > > } > } I tried move $gdb_prompt to other part but still not work. > >> +set test "interrupt" >> +gdb_test_multiple $test $test { >> + -re "interrupt\r\n$gdb_prompt " { >> + pass $test >> + } >> +} >> + >> +set test "inferior stopped" >> +gdb_test_multiple "" $test { >> + -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" { >> + pass $test >> + } >> +} > > > I raise a question here that no one asked before, why don't combine these > two gdb_test_multiple into one? like: > > set test "interrupt inferior" > gdb_test_multiple "interrupt" $test { > -re "interrupt\r\n.*\\\[.* \[0-9\]+\\\] #1 stopped\\\." { > pass $test > } > } This cannot pass test with gdbserver. I think that is why async-shell.exp do something like it. Thanks, Hui