diff options
author | J.T. Conklin <jtc@acorntoolworks.com> | 1994-07-19 17:33:52 +0000 |
---|---|---|
committer | J.T. Conklin <jtc@acorntoolworks.com> | 1994-07-19 17:33:52 +0000 |
commit | 3e304ddfab5812caf0030fcdd533e916277134a6 (patch) | |
tree | 4f824c175b3b79dce3fda7d0ef6fe0e98abe0abf /gdb/testsuite/lib | |
parent | b0a0ee5272ca85c492522ae2c4b1decf9dcae134 (diff) | |
download | gdb-3e304ddfab5812caf0030fcdd533e916277134a6.zip gdb-3e304ddfab5812caf0030fcdd533e916277134a6.tar.gz gdb-3e304ddfab5812caf0030fcdd533e916277134a6.tar.bz2 |
* gdb.base/bitfields.exp: Simplify by using delete_breakpoints and
gdb_test.
* lib/gdb.exp (gdb_test): if match times out, don't call fail if
message is "".
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 9e42606..438eb63 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -25,7 +25,7 @@ global GDB if ![info exists GDB] then { - set GDB [findfile $base_dir/../gdb "gdb" [transform gdb ]] + set GDB [findfile $base_dir/../gdb $base_dir/../gdb [transform gdb ]] } global GDBFLAGS @@ -138,9 +138,10 @@ proc runto { function } { } send "break $function\n" - # The first regexp is what we get with -g, the second without -g. + # The first two regexps are what we get with -g, the third is without -g. expect { - -re "Break.* at .*: file .*, line $decimal.\r\n$prompt $" {} + -re "Breakpoint \[0-9\]* at 0x\[0-9a-f\]*: file .*, line $decimal.\r\n$prompt $" {} + -re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$prompt $" {} -re "Breakpoint \[0-9\]* at 0x\[0-9a-f\]*.*$prompt $" {} -re "$prompt $" { fail "setting breakpoint at $function" ; return 0 } timeout { fail "setting breakpoint at $function (timeout)" ; return 0 } @@ -252,7 +253,9 @@ proc gdb_test { args } { perror "internal buffer is full." } timeout { - fail "(timeout) $message" + if ![string match "" $message] then { + fail "(timeout) $message" + } set result 1 } } @@ -261,8 +264,10 @@ proc gdb_test { args } { # Given an input string, adds backslashes as needed to create a # regexp that will match the string. + proc string_to_regexp {str} { - regsub -all {[]*+.|()^$[]} $str {\\&} result + set result $str + regsub -all {[]*+.|()^$\[]} $str {\\&} result return $result } @@ -406,27 +411,22 @@ proc default_gdb_start { } { global spawn_id global timeout verbose "Spawning $GDB $GDBFLAGS" + + if { [which $GDB] == 0 } then { + perror "$GDB does not exist." + exit 1 + } set oldtimeout $timeout set timeout [expr "$timeout + 60"] if [ llength $GDBFLAGS ] then { - if {[which $GDB] != 0} then { spawn $GDB $GDBFLAGS - } else { - perror "$GDB does not exist." - exit 1 - } } else { - if {[which $GDB] != 0} then { spawn $GDB - } else { - perror "$GDB does not exist." - exit 1 - } } expect { -re ".*\r\n$prompt $" { - verbose "GDB initialized for native mode" + verbose "GDB initialized." } -re "$prompt $" { perror "GDB never initialized." |