From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24573 invoked by alias); 5 Sep 2002 13:35:53 -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 24555 invoked from network); 5 Sep 2002 13:35:52 -0000 Received: from unknown (HELO valrhona.uglyboxes.com) (64.1.192.220) by sources.redhat.com with SMTP; 5 Sep 2002 13:35:52 -0000 Received: from localhost.localdomain (IDENT:fchaHWpWZdSdocaHIHcXKaBKlOwaXWMi@localhost.localdomain [127.0.0.1]) by valrhona.uglyboxes.com (8.11.6/8.11.6) with ESMTP id g85DcaI02559 for ; Thu, 5 Sep 2002 06:38:36 -0700 Date: Thu, 05 Sep 2002 06:35:00 -0000 From: Keith Seitz X-X-Sender: keiths@valrhona.uglyboxes.com To: gdb-patches@sources.redhat.com Subject: [RFA/MI testsuite] Add mi_runto Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-09/txt/msg00064.txt.bz2 Hi, This is a pretty simple patch which removes the guts of mi_run_to_main and adds it all into a new mi_runto which does the same job as gdb's runto procedure. I've tested this on the testsuite and it causes no regressions. Keith ChangeLog 2002-09-05 Keith Seitz * lib/mi-support.exp (mi_runto): New proc. Does the same as gdb's runto proc. (mi_run_to_main): Use mi_runto. Patch Index: testsuite/lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.15 diff -p -r1.15 mi-support.exp *** testsuite/lib/mi-support.exp 4 Sep 2002 21:05:07 -0000 1.15 --- testsuite/lib/mi-support.exp 5 Sep 2002 13:33:07 -0000 *************** proc mi_run_to_main { } { *** 621,657 **** return -1 } - global mi_gdb_prompt - global hex - global decimal global srcdir global subdir global binfile global srcfile - set test "mi run-to-main" mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} ! mi_gdb_test "200-break-insert main" \ ! "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \ ! "breakpoint at main" ! ! mi_run_cmd ! gdb_expect { ! -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[\\\]\|\{\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { ! pass "$test" ! return 0 ! } ! -re ".*$mi_gdb_prompt$" { ! fail "$test (2)" ! } ! timeout { ! fail "$test (timeout)" ! return -1 ! } } } --- 621,679 ---- return -1 } global srcdir global subdir global binfile global srcfile mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} ! mi_runto main ! } ! ! ! # Just like gdb's "runto" proc, it will run the target to a given ! # function. ! # FUNC is the linespec of the place to stop (it inserts a breakpoint here). ! # It returns: ! # -1 if test suppressed, failed, timedout ! # 0 if test passed ! ! proc mi_runto {func} { ! global suppress_flag ! if { $suppress_flag } { ! return -1 ! } ! ! global mi_gdb_prompt expect_out ! global hex decimal ! ! set test "mi runto $func" ! mi_gdb_test "200-break-insert $func" \ ! "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"$func\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \ ! "breakpoint at $func" ! ! if {![regexp {number="[0-9]+"} $expect_out(buffer) str] ! || ![scan $str {number="%d"} bkptno]} { ! set bkptno {[0-9]+} ! } ! ! mi_run_cmd ! gdb_expect { ! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { ! pass "$test" ! return 0 ! } ! -re ".*$mi_gdb_prompt$" { ! fail "$test (2)" ! } ! timeout { ! fail "$test (timeout)" ! return -1 } + } }