aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorKung Hsu <kung@cygnus>1995-03-22 01:11:34 +0000
committerKung Hsu <kung@cygnus>1995-03-22 01:11:34 +0000
commit120edc2f7c086beeceb606b498a62fd0b9394a4b (patch)
tree5d786df5a6a57bc7460928cc17965dfc808b0338 /gdb/testsuite
parent9cc2cd4f7a4dfb8a34c2e9623243deefc4ce2b75 (diff)
downloadgdb-120edc2f7c086beeceb606b498a62fd0b9394a4b.zip
gdb-120edc2f7c086beeceb606b498a62fd0b9394a4b.tar.gz
gdb-120edc2f7c086beeceb606b498a62fd0b9394a4b.tar.bz2
* lib/gdb.exp: add proc runto_main, for targets that use stubs, this
will not runto main but do a 'step' to step out of breakpoint().
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/lib/gdb.exp47
1 files changed, 47 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b010303..2ea53e7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -43,6 +43,17 @@ if ![info exists prompt] then {
set prompt "\[(\]gdb\[)\]"
}
+global usestubs
+if [istarget "sparclite-*-*"] then {
+ set usestubs 1
+} else {
+ set usestubs 0
+}
+
+if ![info exists noargs] then {
+ set noargs 0
+}
+
#
# gdb_version -- extract and print the version number of GDB
#
@@ -191,6 +202,42 @@ proc runto { function } {
}
#
+# runto_main -- ask gdb to run and untill hit break point at main.
+# if it uses stubs, assuming we hit breakpoint() and just
+# step out of the function.
+#
+proc runto_main {} {
+ global prompt
+ global decimal
+ global usestubs
+
+ if $usestubs==0 {
+ runto main
+ return 1
+ }
+
+ send "delete\n"
+ expect {
+ -re "delete.*Delete all breakpoints.*y or n. $" {
+ send "y\n"
+ expect {
+ -re "$prompt $" {}
+ timeout { fail "deleting breakpoints (timeout)" ; return 0 }
+ }
+ }
+ -re ".*$prompt $" {}
+ timeout { fail "deleting breakpoints (timeout)" ; return 0 }
+ }
+
+ send "step\n"
+ # if use stubs step out of the breakpoint() function.
+ expect {
+ -re "* at .*$prompt $" {}
+ timeout { fail "single step at breakpoint() (timeout)" ; return 0 }
+ }
+}
+
+#
# gdb_test -- send a command to gdb and test the result.
# Takes three parameters.
# Parameters: