* 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 "".
This commit is contained in:
J.T. Conklin
1994-07-19 17:33:52 +00:00
parent b0a0ee5272
commit 3e304ddfab
3 changed files with 134 additions and 218 deletions

View File

@ -1,3 +1,11 @@
Tue Jul 19 10:26:32 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
* 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 "".
Mon Jul 18 12:18:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com) Mon Jul 18 12:18:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
* gdb.base/{a2-run,callfuncs,funcargs,interrupt,mips_pro,nodebug, * gdb.base/{a2-run,callfuncs,funcargs,interrupt,mips_pro,nodebug,

View File

@ -1,4 +1,4 @@
# Copyright (C) 1992 Free Software Foundation, Inc. # Copyright (C) 1992, 1994 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -47,10 +47,9 @@ proc bitfield_uniqueness {} {
global srcfile global srcfile
global det_file global det_file
send "break break1\n" if [gdb_test "break break1" "Break.* at $hex: file .*$srcfile, line $decimal" ""] {
expect { fail "setting breakpoint at break1"
-re "Break.* at $hex: file .*$srcfile, line $decimal.\r\n$prompt $" {} return
timeout { fail "setting breakpoint at break1" ; return }
} }
send "run\n" send "run\n"
@ -63,113 +62,84 @@ proc bitfield_uniqueness {} {
timeout { fail "running to break1" ; return } timeout { fail "running to break1" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
expect { fail "bitfield uniqueness (uc)"
-re ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "bitfield uniqueness (uc)" ; return }
} }
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
send "cont\n" fail "continuing to break1"
expect { return
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
} }
send "print flags\n"
# Note that we check for s1 as either 1 or -1, so that failure to # Note that we check for s1 as either 1 or -1, so that failure to
# treat it correctly as a signed 1bit field (values 0 or -1) while # treat it correctly as a signed 1bit field (values 0 or -1) while
# printing its value does not cause a spurious failure. We do the # printing its value does not cause a spurious failure. We do the
# signedness preservation test later. # signedness preservation test later.
expect { if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
-re ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {} fail "bitfield uniqueness (s1)"
timeout { fail "bitfield uniqueness (s1)" ; return } return
} }
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
send "cont\n" fail "continuing to break1"
expect { return
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {} }
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
fail "bitfield uniqueness (u1)"
return
}
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
fail "continuing to break1"
return
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
fail "bitfield uniqueness (s2)"
return
}
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
fail "continuing to break1"
return
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
fail "bitfield uniqueness (u2)"
return
}
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
fail "continuing to break1"
return
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0" ""] {
fail "bitfield uniqueness (s3)"
return
}
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
fail "continuing to break1"
return
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0" "" ] {
fail "bitfield uniqueness (u3)"
return
}
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
timeout { fail "continuing to break1" ; return } timeout { fail "continuing to break1" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0" "" ] {
expect { fail "bitfield uniqueness (s9)"
-re ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "bitfield uniqueness (u1)" ; return }
} }
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
send "cont\n" fail "continuing to break1"
expect { return
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0" "" ] {
expect { fail "bitfield uniqueness (u9)"
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "bitfield uniqueness (s2)" ; return }
} }
if [gdb_test "cont" "Break.*break1 \[)(\]+ at .*$srcfile:$decimal" ""] {
send "cont\n" fail "continuing to break1"
expect { return
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1" "" ] {
expect { fail "bitfield uniqueness (sc)"
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "bitfield uniqueness (u2)" ; return }
}
send "cont\n"
expect {
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
}
send "print flags\n"
expect {
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {}
timeout { fail "bitfield uniqueness (s3)" ; return }
}
send "cont\n"
expect {
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
}
send "print flags\n"
expect {
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0 .*$prompt $" {}
timeout { fail "bitfield uniqueness (u3)" ; return }
}
send "cont\n"
expect {
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
}
send "print flags\n"
expect {
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0 .*$prompt $" {}
timeout { fail "bitfield uniqueness (s9)" ; return }
}
send "cont\n"
expect {
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
}
send "print flags\n"
expect {
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0 .*$prompt $" {}
timeout { fail "bitfield uniqueness (u9)" ; return }
}
send "cont\n"
expect {
-re "Break.*break1 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {}
timeout { fail "continuing to break1" ; return }
}
send "print flags\n"
expect {
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1 .*$prompt $" {}
timeout { fail "bitfield uniqueness (sc)" ; return }
} }
pass "bitfield locating and uniqueness" pass "bitfield locating and uniqueness"
@ -189,22 +159,11 @@ proc bitfield_containment {} {
global srcfile global srcfile
global det_file global det_file
send "delete\n" delete_breakpoints
expect {
-re "Delete all breakpoints.*y or n. $" {
send "y\n"
expect {
-re "$prompt $" {}
timeout { fail "deleting breakpoints" ; return }
}
}
timeout { fail "deleting breakpoints" ; return }
}
send "break break2\n" if [gdb_test "break break2" "Break.* at $hex: file .*$srcfile, line $decimal" ""] {
expect { fail "setting breakpoint at break2"
-re "Break.* at $hex: file .*$srcfile, line $decimal.\r\n$prompt $" {} return
timeout { fail "setting breakpoint at break2" ; return }
} }
send "run\n" send "run\n"
@ -217,25 +176,22 @@ proc bitfield_containment {} {
timeout { fail "running to break2" ; return } timeout { fail "running to break2" ; return }
} }
send "print/x flags\n" if [gdb_test "print/x flags" ".*uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0" ""] {
expect { fail "bitfield containment"
-re ".*uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0.*$prompt $" {} return
timeout { fail "bitfield containment" ; return }
} }
send "cont\n" if [gdb_test "cont" "Break.*break2 \[)(\]+ at .*$srcfile:$decimal" ""] {
expect { fail "continuing to break2"
-re "Break.*break2 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {} return
timeout { fail "continuing to break2" ; return }
} }
# If program is compiled with Sun CC, then these print out as their # If program is compiled with Sun CC, then these print out as their
# actual sizes; if compiled with gcc, they print out as 0xffffffff # actual sizes; if compiled with gcc, they print out as 0xffffffff
# (which strikes me as bogus, but accept it at least for now). # (which strikes me as bogus, but accept it at least for now).
send "print/x flags\n" if [gdb_test "print/x flags" ".*uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff" ""] {
expect { fail "bitfield containment"
-re ".*uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff.*$prompt $" {} return
timeout { fail "bitfield containment" ; return }
} }
pass "bitfield containment" pass "bitfield containment"
@ -255,22 +211,11 @@ proc bitfield_unsignedness {} {
global srcfile global srcfile
global det_file global det_file
send "delete\n" delete_breakpoints
expect {
-re "Delete all breakpoints.*y or n. $" {
send "y\n"
expect {
-re "$prompt $" {}
timeout { fail "deleting breakpoints" ; return }
}
}
timeout { fail "deleting breakpoints" ; return }
}
send "break break3\n" if [gdb_test "break break3" "Break.* at $hex: file .*$srcfile, line $decimal" ""] {
expect { fail "setting breakpoint at break3"
-re "Break.* at $hex: file .*$srcfile, line $decimal.\r\n$prompt $" {} return
timeout { fail "setting breakpoint at break3" ; return }
} }
send "run\n" send "run\n"
@ -283,10 +228,9 @@ proc bitfield_unsignedness {} {
timeout { fail "running to break3" ; return } timeout { fail "running to break3" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0" "" ] {
expect { fail "unsigned bitfield ranges"
-re ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0 .*$prompt $" {} return
timeout { fail "unsigned bitfield ranges" ; return }
} }
pass "unsigned bitfield ranges and unsigned-ness" pass "unsigned bitfield ranges and unsigned-ness"
@ -306,22 +250,11 @@ proc bitfield_signedness {} {
global srcfile global srcfile
global det_file global det_file
send "delete\n" delete_breakpoints
expect {
-re "Delete all breakpoints.*y or n. $" {
send "y\n"
expect {
-re "$prompt $" {}
timeout { warning "deleting breakpoints (timedout)" ; return }
}
}
timeout { warning "deleting breakpoints (timedout)" ; return }
}
send "break break4\n" if [gdb_test "break break4" "Break.* at $hex: file .*$srcfile, line $decimal" ""] {
expect { fail "setting breakpoint at break4"
-re "Break.* at $hex: file .*$srcfile, line $decimal.\r\n$prompt $" {} return
timeout { fail "setting breakpoint at break4" ; return }
} }
send "run\n" send "run\n"
@ -334,16 +267,14 @@ proc bitfield_signedness {} {
timeout { fail "running to break4" ; return } timeout { fail "running to break4" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0" ""] {
expect { fail "signed bitfields, max positive values"
-re ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "signed bitfields, max positive values" ; return }
} }
send "cont\n" if [gdb_test "cont" "Break.*break4 \[)(\]+ at .*$srcfile:$decimal" "" ] {
expect { fail "continuing to break4"
-re "Break.*break4 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {} return
timeout { fail "continuing to break4" ; return }
} }
# Determine if the target has signed bitfields so we can xfail the # Determine if the target has signed bitfields so we can xfail the
@ -352,28 +283,25 @@ proc bitfield_signedness {} {
expect { expect {
-re ".* = -256.*$prompt $" {} -re ".* = -256.*$prompt $" {}
-re ".* = 256.*$prompt $" {setup_xfail "*-*-*"} -re ".* = 256.*$prompt $" {setup_xfail "*-*-*"}
-re ".*$prompt $" { fail "\ -re ".*$prompt $" { fail "determining signed-ness of bitfields (known bug in sparc gcc 2.4.5)"
determining signed-ness of bitfields (known bug in sparc gcc 2.4.5)"
return return
} }
default { fail "determining signed-ness of bitfields" ; return } default { fail "determining signed-ness of bitfields" ; return }
} }
send "print flags\n"
expect { if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0" ""] {
-re ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0 .*$prompt $" {} fail "signed bitfields, max negative values"
timeout { fail "signed bitfields, max negative values" ; return } return
} }
send "cont\n" if [gdb_test "cont" "Break.*break4 \[)(\]+ at .*$srcfile:$decimal" ""] {
expect { fail "continuing to break4"
-re "Break.*break4 \[)(\]+ at .*$srcfile:$decimal.*$prompt $" {} return
timeout { fail "continuing to break4" ; return }
} }
send "print flags\n" if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0" ""] {
expect { fail "signed bitfields with -1"
-re ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0 .*$prompt $" {} return
timeout { fail "signed bitfields with -1" ; return }
} }
pass "signed bitfield ranges and signed-ness" pass "signed bitfield ranges and signed-ness"
@ -395,11 +323,6 @@ if [istarget "mips-idt-*"] then {
gdb_reinitialize_dir $srcdir/$subdir gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile gdb_load $objdir/$subdir/$binfile
} }
if [istarget "a29k-*-udi"] then {
# FIXME: If PR 2415 is fixed, this is not needed.
gdb_target_udi
gdb_load $objdir/$subdir/$binfile
}
bitfield_containment bitfield_containment
if [istarget "mips-idt-*"] then { if [istarget "mips-idt-*"] then {
# Restart because IDT/SIM runs out of file descriptors. # Restart because IDT/SIM runs out of file descriptors.
@ -408,11 +331,6 @@ if [istarget "mips-idt-*"] then {
gdb_reinitialize_dir $srcdir/$subdir gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile gdb_load $objdir/$subdir/$binfile
} }
if [istarget "a29k-*-udi"] then {
# FIXME: If PR 2415 is fixed, this is not needed.
gdb_target_udi
gdb_load $objdir/$subdir/$binfile
}
bitfield_unsignedness bitfield_unsignedness
if [istarget "mips-idt-*"] then { if [istarget "mips-idt-*"] then {
# Restart because IDT/SIM runs out of file descriptors. # Restart because IDT/SIM runs out of file descriptors.
@ -421,14 +339,4 @@ if [istarget "mips-idt-*"] then {
gdb_reinitialize_dir $srcdir/$subdir gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile gdb_load $objdir/$subdir/$binfile
} }
if [istarget "a29k-*-udi"] then {
# FIXME: If PR 2415 is fixed, this is not needed.
gdb_target_udi
gdb_load $objdir/$subdir/$binfile
}
bitfield_signedness bitfield_signedness
if [istarget "a29k-*-udi"] then {
# FIXME: If PR 2415 is fixed, this is not needed.
gdb_target_udi
}

View File

@ -25,7 +25,7 @@
global GDB global GDB
if ![info exists GDB] then { 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 global GDBFLAGS
@ -138,9 +138,10 @@ proc runto { function } {
} }
send "break $function\n" 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 { 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 "Breakpoint \[0-9\]* at 0x\[0-9a-f\]*.*$prompt $" {}
-re "$prompt $" { fail "setting breakpoint at $function" ; return 0 } -re "$prompt $" { fail "setting breakpoint at $function" ; return 0 }
timeout { fail "setting breakpoint at $function (timeout)" ; return 0 } timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
@ -252,7 +253,9 @@ proc gdb_test { args } {
perror "internal buffer is full." perror "internal buffer is full."
} }
timeout { timeout {
fail "(timeout) $message" if ![string match "" $message] then {
fail "(timeout) $message"
}
set result 1 set result 1
} }
} }
@ -261,8 +264,10 @@ proc gdb_test { args } {
# Given an input string, adds backslashes as needed to create a # Given an input string, adds backslashes as needed to create a
# regexp that will match the string. # regexp that will match the string.
proc string_to_regexp {str} { proc string_to_regexp {str} {
regsub -all {[]*+.|()^$[]} $str {\\&} result set result $str
regsub -all {[]*+.|()^$\[]} $str {\\&} result
return $result return $result
} }
@ -407,26 +412,21 @@ proc default_gdb_start { } {
global timeout global timeout
verbose "Spawning $GDB $GDBFLAGS" verbose "Spawning $GDB $GDBFLAGS"
if { [which $GDB] == 0 } then {
perror "$GDB does not exist."
exit 1
}
set oldtimeout $timeout set oldtimeout $timeout
set timeout [expr "$timeout + 60"] set timeout [expr "$timeout + 60"]
if [ llength $GDBFLAGS ] then { if [ llength $GDBFLAGS ] then {
if {[which $GDB] != 0} then {
spawn $GDB $GDBFLAGS spawn $GDB $GDBFLAGS
} else {
perror "$GDB does not exist."
exit 1
}
} else { } else {
if {[which $GDB] != 0} then {
spawn $GDB spawn $GDB
} else {
perror "$GDB does not exist."
exit 1
}
} }
expect { expect {
-re ".*\r\n$prompt $" { -re ".*\r\n$prompt $" {
verbose "GDB initialized for native mode" verbose "GDB initialized."
} }
-re "$prompt $" { -re "$prompt $" {
perror "GDB never initialized." perror "GDB never initialized."