From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26220 invoked by alias); 26 May 2010 17:38:53 -0000 Received: (qmail 26210 invoked by uid 22791); 26 May 2010 17:38:52 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 May 2010 17:38:47 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 0102632005; Wed, 26 May 2010 10:38:46 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost2.vmware.com (Postfix) with ESMTP id EA6EE8E741; Wed, 26 May 2010 10:38:45 -0700 (PDT) Message-ID: <4BFD5CA5.9070605@vmware.com> Date: Wed, 26 May 2010 17:41:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Joel Brobecker CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] gdb.base a*.exp b*.exp send_gdb vs gdb_test References: <4BFAEFF9.9050709@vmware.com> <20100526173247.GA3019@adacore.com> In-Reply-To: <20100526173247.GA3019@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2010-05/txt/msg00603.txt.bz2 Joel Brobecker wrote: >> 2010-05-22 Michael Snyder >> >> * gdb.base/a2-run.exp: Replace send_gdb with gdb_test. >> * gdb.base/all-bin.exp: Replace send_gdb with gdb_test. >> * gdb.base/annota1.exp: Replace send_gdb with gdb_test. >> * gdb.base/annota3.exp: Replace send_gdb with gdb_test. >> * gdb.base/assign.exp: Replace send_gdb with gdb_test. >> * gdb.base/attach.exp: Replace send_gdb with gdb_test. >> * gdb.base/bitfields.exp: Replace send_gdb with gdb_test. >> * gdb.base/bitfields2.exp: Replace send_gdb with gdb_test. >> * gdb.base/bitops.exp: Replace send_gdb with gdb_test. > > One general question: > >> -gdb_expect { >> +gdb_test_multiple "run" "run until main breakpoint" { >> -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" { >> pass "run until main breakpoint" >> } >> - -re ".*$gdb_prompt$" { >> - fail "run until main breakpoint" >> - } >> - timeout { >> - fail "run until main breakpoint (timeout)" >> - } >> - } >> +} > > It looks to me that this one could have been written using a simple > gdb_test, since I don't see us using the output at all? > >> -send_gdb "next\n" >> -gdb_expect { >> - -re ".*$gdb_prompt$" { pass "go after array init line" } >> - timeout { fail "go after array init line (timeout)" } >> +gdb_test_multiple "next" "go after array init line" { >> + -re "source .*annota1.c.*$gdb_prompt$" { >> + pass "go after array init line" >> + } >> } > > Same for this one? > > In fact, starting from here, you suddendly started using gdb_test_multiple > even when there was only one regexp used. I'm probably missing someting...? > Is it something in the output that make it unsuitable for gdb_test? No, it's the regexp. It ends with "$gdb_prompt$", with no trailing space. gdb_test requires the output to end with "$gdb_prompt $", including the trailing space. Subtle but critical. ;-))