Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/MI testsuite] Add mi_runto
Date: Thu, 05 Sep 2002 06:35:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0209050627210.1407-100000@valrhona.uglyboxes.com> (raw)

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  <keiths@redhat.com>

	* 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
      }
+   }
  }
  
  


             reply	other threads:[~2002-09-05 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-05  6:35 Keith Seitz [this message]
2002-09-09 19:31 ` Elena Zannoni
2002-09-10  7:31   ` Keith Seitz
2002-09-10  7:42     ` Elena Zannoni
2002-09-10  7:49       ` Keith Seitz
2002-09-10 14:58         ` Elena Zannoni
2002-09-10 15:22           ` Keith Seitz
2002-09-10 15:25             ` Elena Zannoni
2002-09-10 15:30               ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0209050627210.1407-100000@valrhona.uglyboxes.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox