From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26487 invoked by alias); 4 May 2005 18:46:25 -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 26430 invoked from network); 4 May 2005 18:46:22 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 4 May 2005 18:46:22 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DTOt2-0005Az-E2; Wed, 04 May 2005 14:46:20 -0400 Date: Wed, 04 May 2005 18:46:00 -0000 From: Daniel Jacobowitz To: Manoj Iyer Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] new GDB server testcase Message-ID: <20050504184620.GA19639@nevyn.them.org> Mail-Followup-To: Manoj Iyer , gdb-patches@sources.redhat.com References: <20050504144044.GA14120@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00132.txt.bz2 On Wed, May 04, 2005 at 01:36:48PM -0500, Manoj Iyer wrote: > -gdb_breakpoint main > -gdb_test "continue" "Breakpoint.* main .*" "continue to main" > +gdb_test "br main" "Breakpoint 1.*at.* file .*$srcfile, line \[0-9\]+.*" > + > +gdb_test "continue" ".*Continuing\\..*Breakpoint \[0-9\]+, main.*at .*$srcfile:\[0-9\].*" Why not use gdb_breakpoint? Is it because you want to test that the breakpoint was placed in the right file? If so, you need to use a regular expression for the breakpoint number as below. I'd rather just use gdb_breakpoint though. > +send_gdb "list \n" > +gdb_expect { > + -re ".*main.*\{.*$gdb_prompt $" { > + pass "list commands can display source code" } > + timeout { fail "list command failed to display source code" } > +} Why not use gdb_test for this? > +gdb_test "br function3" "Breakpoint 2.*at.* file .*$srcfile, line \[0-9\]+.*" > + > +gdb_test "continue" ".*Continuing\\..*Breakpoint \[0-9\]+, function3.*at .*$srcfile:\[0-9\].*" > + > +send_gdb "backtrace\n" > +gdb_expect_list "backtrace" ".*$gdb_prompt $" { > + "#0.*function3.*at.*server.c:\[0-9\]+" > + "#1.*function2.*at.*server.c:\[0-9\]+" > + "#2.*function1.*at.*server.c:\[0-9\]+" > + "#3.*main.*at.*server.c:\[0-9\]+" > +} Try to avoid using send_gdb directly. You can construct the pattern in a variable and use gdb_test. > +gdb_test "step" "function4.*at .*$srcfile:\[0-9\]+.*" > + > +gdb_test "step 3" ".*${decimal}.*y = x.* y;.*" That's a lot of wildcards. Can't you put a marker comment on the lines you want to reach? > +gdb_test "print x" ".*3.*" Please be more precise. "\$\[0-9\]* = 3" should be enough. -- Daniel Jacobowitz CodeSourcery, LLC