From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28724 invoked by alias); 29 Mar 2004 21:04:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28716 invoked from network); 29 Mar 2004 21:04:02 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 29 Mar 2004 21:04:02 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i2TL411X031915 for ; Mon, 29 Mar 2004 16:04:01 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i2TL41j26205; Mon, 29 Mar 2004 16:04:01 -0500 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i2TL40f7019339; Mon, 29 Mar 2004 16:04:00 -0500 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id B7CF880008E; Mon, 29 Mar 2004 16:04:00 -0500 (EST) Message-ID: <40688F40.1010106@redhat.com> Date: Mon, 29 Mar 2004 21:04:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] New thread test to exercise Daniel's Patch References: <20040325043950.GA13188@nevyn.them.org> <20040325163437.GA15238@nevyn.them.org> <40633F75.5010908@redhat.com> <20040326175906.GA21136@nevyn.them.org> <406472FB.4010905@redhat.com> <40649CEE.4070607@redhat.com> <20040326211958.GA31610@nevyn.them.org> <4068658F.2070903@redhat.com> <20040329181122.GB22039@nevyn.them.org> <4068849B.7030800@redhat.com> <20040329204204.GA3251@nevyn.them.org> In-Reply-To: <20040329204204.GA3251@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-03/txt/msg00733.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Mar 29, 2004 at 03:18:35PM -0500, Jeff Johnston wrote: > >>Daniel Jacobowitz wrote: >> >>>On Mon, Mar 29, 2004 at 01:06:07PM -0500, Jeff Johnston wrote: >>> >>> >>>>>>+send_gdb "continue\n" >>>>>>+gdb_expect { >>>>> >>>>> >>>>>Everywhere you're using gdb_expect, please use gdb_test_multiple >>>>>instead. For the "after" tests, you can use gdb_test_multiple with >>>>>"" as the first argument. >>>>> >>>> >>>>I tried this initially but I kept getting "Error: internal buffer is >>>>full". I tried lowering the "after" time which is why it ended up 100 >>>>below but that didn't solve the problem. Any suggestions on how to avoid >>>>the "full_buffer" error. >>> >>> >>>I'm not sure about the regexes, since I'm just pulling this out of the >>>top of my head, but you want something like this: >>> >>> -re "error:.*$gdb_prompt $" { >>> fail "msg" >>> } >>> -re "\\\[New thread \[^\]\]*\\\]\r\n" { >>> exp_continue >>> } >>> -re "\\\[Thread \[^\]\]* exited\\\]\r\n" { >>> exp_continue >>> } >>> >>>That will consume any thread create/delete messages, instead of leaving >>>them in the buffer. >>> >> >>Forgive my ignorance of the test macros, but how does this terminate? I >>tried doing it this way and it hangs. It never gets a gdb prompt and spits >>out endless messages because it is essentially an infinite loop. I only >>care to see the "Continuing" message and don't care about the rest of the >>stuff. >> >>I stole the original send_gdb / gdb_expect code from schedlock.exp which >>has the same problem. > > > Hmm, I must have misunderstood. Which part of the test gives you a > full buffer error? I'm thinking of something like this: > > gdb_test_multiple "continue" { > -re "error:.*$gdb_prompt $" { > fail "msg" > } > -re "Continuing" { > pass "msg" > } > } > > after 1000 { send_gdb "\003" } > gdb_test_multiple "" { > -re "error:.*$gdb_prompt $" { > fail "msg" > } > -re "$gdb_prompt $" { > pass "msg" > } > -re "\\\[New thread \[^\]\]*\\\]\r\n" { > exp_continue > } > -re "\\\[Thread \[^\]\]* exited\\\]\r\n" { > exp_continue > } > } > > Those will catch any error messages and treat them as failures. > Ok, I had the thread checks in the Continue test. If I change it to the way above, now I get 3 "Process no longer exists "messages but the test completes. :( I'm really starting to hate these test macros. What is the reasoning behind avoiding send_gdb / gdb_expect? -- Jeff J.