From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6314 invoked by alias); 10 Sep 2002 02:31:54 -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 6307 invoked from network); 10 Sep 2002 02:31:53 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 10 Sep 2002 02:31:53 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 07779106CC; Mon, 9 Sep 2002 22:30:03 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15741.22826.911452.93307@localhost.redhat.com> Date: Mon, 09 Sep 2002 19:31:00 -0000 To: Keith Seitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/MI testsuite] Add mi_runto In-Reply-To: References: X-SW-Source: 2002-09/txt/msg00140.txt.bz2 Keith Seitz writes: > 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 > Same question as for the other patch. How does this interact with mi_run_to? Do we need both versions? It looks ok otherwise. Elena > 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 > } > + } > } > >