* gdb.*/*.exp: Replace $prompt with $gdb_prompt.

* gdb.base/scope.exp: Use gdb_test.
	* gdb.c++/classes.exp: Ditto.
	* gdb.c++/inherit.exp: Ditto.

More random cleanups. Still lots to go, however.
This commit is contained in:
Bob Manson 1997-02-02 07:59:25 +00:00
parent e385d6e03e
commit 85fbaa747f
59 changed files with 670 additions and 662 deletions

View File

@ -1,3 +1,11 @@
Sat Feb 1 23:51:01 1997 Bob Manson <manson@charmed.cygnus.com>
* gdb.*/*.exp: Replace $prompt with $gdb_prompt.
* gdb.base/scope.exp: Use gdb_test.
* gdb.c++/classes.exp: Ditto.
* gdb.c++/inherit.exp: Ditto.
Fri Jan 31 13:09:12 1997 Bob Manson <manson@charmed.cygnus.com>
* gdb.base/crossload.exp: Don't use execute_anywhere, use

View File

@ -22,7 +22,7 @@ load_lib gdb.exp
# Set gdb to target the monitor
#
proc gdb_target_monitor { } {
global prompt
global gdb_prompt
global exit_status
global timeout
@ -89,7 +89,7 @@ proc gdb_load { arg } {
global loadpath
global loadfile
global GDB
global prompt
global gdb_prompt
global timeout
if { $arg != "" } {
@ -108,13 +108,13 @@ proc gdb_load { arg } {
set timeout 1000
verbose "Timeout is now $timeout seconds" 2
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
if { $verbose > 1 } {
send_user "Loaded $arg into $GDB\n"
}
return 1
}
-re "$prompt $" {
-re "$gdb_prompt $" {
if { $verbose > 1 } {
perror "GDB couldn't load."
}

View File

@ -29,7 +29,7 @@ proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global prompt
global gdb_prompt
global GDB
set loadfile [file tail $arg]
set loadpath [file dirname $arg]
@ -43,7 +43,7 @@ proc gdb_start { } {
global GDB
global GDBFLAGS
global spawn_id
global prompt
global gdb_prompt
global verbose
send_user "Not implememted yet\n" ; return -1
}

View File

@ -32,7 +32,7 @@
load_lib remote.exp
load_lib gdb.exp
set prompt "\\(gdb\\)"
set gdb_prompt "\\(gdb\\)"
#
# gdb_load -- load a file into the GDB.
@ -43,7 +43,7 @@ proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global prompt
global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
@ -61,8 +61,8 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Reading symbols from.*done..*$prompt $" {}
-i $gdb_spawn_id -re "$prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id -re "Reading symbols from.*done..*$gdb_prompt $" {}
-i $gdb_spawn_id -re "$gdb_prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id timeout { perror "(timeout) read symbol file" ; return -1 }
}
@ -86,8 +86,8 @@ proc gdb_load { arg } {
set timeout 60
verbose "Timeout is now $timeout seconds" 2
expect {
-i $gdb_spawn_id -re "Remote target.*$prompt $" { }
-i $gdb_spawn_id -re ".*SPARClite appears to be alive.*$prompt $" {
-i $gdb_spawn_id -re "Remote target.*$gdb_prompt $" { }
-i $gdb_spawn_id -re ".*SPARClite appears to be alive.*$gdb_prompt $" {
if $verbose>1 then {
send_user "Set target to $targetname\n"
}
@ -111,12 +111,12 @@ proc gdb_load { arg } {
set timeout 2400
verbose "Timeout is now $timeout seconds" 2
expect {
-i $gdb_spawn_id -re "Loading.*$prompt $" {
-i $gdb_spawn_id -re "Loading.*$gdb_prompt $" {
verbose "Loaded $arg into $GDB" 1
set timeout 30
verbose "Timeout is now $timeout seconds" 2
}
-i $gdb_spawn_id -re "$prompt $" {
-i $gdb_spawn_id -re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
@ -134,7 +134,7 @@ proc gdb_load { arg } {
sleep 2;
send_gdb "";
expect {
-i $gdb_spawn_id -re ".*$prompt $" { verbose "Run command succeded" }
-i $gdb_spawn_id -re ".*$gdb_prompt $" { verbose "Run command succeded" }
-i $gdb_spawn_id default {
perror "error sending monitor run command";
}
@ -153,7 +153,7 @@ proc gdb_load { arg } {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Set remote target to [target_info serial]" 2
}
-i $gdb_spawn_id timeout {

View File

@ -24,7 +24,7 @@
load_lib remote.exp
load_lib gdb.exp
set prompt "\\(gdbslet\\)"
set gdb_prompt "\\(gdbslet\\)"
#
@ -37,7 +37,7 @@ set prompt "\\(gdbslet\\)"
#
proc gdb_run_cmd {} {
global prompt
global gdb_prompt
global gdb_spawn_id
set timeout 60
@ -74,8 +74,8 @@ proc gdb_run_cmd {} {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Remote target.*$prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$prompt $" {
-i $gdb_spawn_id -re "Remote target.*$gdb_prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$gdb_prompt $" {
if $verbose>1 then {
send_user "Set target to $targetname\n"
}
@ -90,7 +90,7 @@ proc gdb_run_cmd {} {
send_gdb "disable\n";
expect {
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Breakpoints disabled" 2
}
-i $gdb_spawn_id timeout {
@ -132,7 +132,7 @@ proc gdb_run_cmd {} {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "interrupting remote stub succeeded"
}
-i $gdb_spawn_id timeout {
@ -151,7 +151,7 @@ proc gdb_run_cmd {} {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "connected to stub at [target_info gdb_serial]" 2
}
-i $gdb_spawn_id timeout {
@ -165,7 +165,7 @@ proc gdb_run_cmd {} {
send_gdb "enable\n";
expect {
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Breakpoints enabled" 2
}
-i $gdb_spawn_id timeout {
@ -190,7 +190,7 @@ proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global prompt
global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
@ -215,8 +215,8 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Reading symbols from.*done..*$prompt $" {}
-i $gdb_spawn_id -re "$prompt $" { perror "GDB couldn't find loader" }
-i $gdb_spawn_id -re "Reading symbols from.*done..*$gdb_prompt $" {}
-i $gdb_spawn_id -re "$gdb_prompt $" { perror "GDB couldn't find loader" }
-i $gdb_spawn_id timeout {
perror "(timeout) read symbol file" ;
return -1
@ -235,8 +235,8 @@ proc gdb_load { arg } {
send_gdb "target $protocol udp [target_info netport]\n";
}
expect {
-i $gdb_spawn_id -re "Remote target.*$prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$prompt $" {
-i $gdb_spawn_id -re "Remote target.*$gdb_prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$gdb_prompt $" {
if $verbose>1 then {
send_user "Set target to $targetname\n"
}
@ -280,7 +280,7 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Running loader succeeded"
}
-i $gdb_spawn_id timeout {
@ -304,8 +304,8 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Reading symbols from.*done..*$prompt $" {}
-i $gdb_spawn_id -re "$prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id -re "Reading symbols from.*done..*$gdb_prompt $" {}
-i $gdb_spawn_id -re "$gdb_prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id timeout {
perror "(timeout) read symbol file" ;
return -1
@ -319,7 +319,7 @@ proc gdb_load { arg } {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Set remote target to [target_info serial]" 2
}
-i $gdb_spawn_id timeout {
@ -340,12 +340,12 @@ proc gdb_load { arg } {
set timeout 1200
verbose "Timeout is now $timeout seconds" 2
expect {
-i $gdb_spawn_id -re "Loading.*$prompt $" {
-i $gdb_spawn_id -re "Loading.*$gdb_prompt $" {
verbose "Loaded $arg into $GDB" 1
set timeout 60
verbose "Timeout is now $timeout seconds" 2
}
-i $gdb_spawn_id -re "$prompt $" {
-i $gdb_spawn_id -re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
@ -384,8 +384,8 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Remote target.*$prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$prompt $" {
-i $gdb_spawn_id -re "Remote target.*$gdb_prompt $" { }
-i $gdb_spawn_id -re ".*SPARCLET appears to be alive.*$gdb_prompt $" {
if $verbose>1 then {
send_user "Set target to $targetname\n"
}
@ -429,7 +429,7 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "interrupting remote stub succeeded"
}
-i $gdb_spawn_id timeout {
@ -448,7 +448,7 @@ proc gdb_load { arg } {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "connected to stub at [target_info gdb_serial]" 2
}
-i $gdb_spawn_id timeout {

View File

@ -24,7 +24,7 @@
load_lib remote.exp
load_lib gdb.exp
set prompt "\\(gdbslet\\)"
set gdb_prompt "\\(gdbslet\\)"
#
@ -38,7 +38,7 @@ set prompt "\\(gdbslet\\)"
proc gdb_start { } {
global gdb_spawn_id;
global prompt
global gdb_prompt
global GDB
if { [default_gdb_start] != 0 } {
@ -48,7 +48,7 @@ proc gdb_start { } {
if [target_info exists baud] {
send_gdb "set remotebaud [target_info baud]\n"
expect {
-i $gdb_spawn_id -re ".*$prompt" { }
-i $gdb_spawn_id -re ".*$gdb_prompt" { }
-i $gdb_spawn_id default {
perror "Error setting baud rate."
return -1;
@ -67,7 +67,7 @@ proc gdb_start { } {
proc gdb_sparclet_startup { } {
global gdb_spawn_id;
global prompt
global gdb_prompt
global GDB
set timeout 5;
@ -79,13 +79,13 @@ proc gdb_sparclet_startup { } {
gdb_send "y\n";
exp_continue;
}
-i $gdb_spawn_id -re "Remote target.*connected to.*$prompt" { }
-i $gdb_spawn_id -re "Remote target.*connected to.*$gdb_prompt" { }
-i $gdb_spawn_id timeout {
verbose "timed out, checking if stub is already running"
set timeout 10
send_gdb "\003";
expect {
-i $gdb_spawn_id -re ".*$prompt" {
-i $gdb_spawn_id -re ".*$gdb_prompt" {
}
-i $gdb_spawn_id default {
perror "sparclet board isn't responding";
@ -94,7 +94,7 @@ proc gdb_sparclet_startup { } {
}
send_gdb "target remote [target_info gdb_serial]\n";
expect {
-i $gdb_spawn_id -re ".*Remote debugging.*$prompt" {
-i $gdb_spawn_id -re ".*Remote debugging.*$gdb_prompt" {
verbose "stub is already running"
set is_running_stub 1;
}
@ -123,8 +123,8 @@ proc gdb_sparclet_startup { } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Reading symbols from.*done..*$prompt $" {}
-i $gdb_spawn_id -re "$prompt $" { perror "GDB couldn't find loader" }
-i $gdb_spawn_id -re "Reading symbols from.*done..*$gdb_prompt $" {}
-i $gdb_spawn_id -re "$gdb_prompt $" { perror "GDB couldn't find loader" }
-i $gdb_spawn_id timeout {
perror "(timeout) read symbol file" ;
return -1
@ -133,7 +133,7 @@ proc gdb_sparclet_startup { } {
send_gdb "target [target_info gdb_protocol] [target_info serial]\n";
expect {
-i $gdb_spawn_id -re "Remote target.*connected to.*$prompt" { }
-i $gdb_spawn_id -re "Remote target.*connected to.*$gdb_prompt" { }
-i $gdb_spawn_id default {
perror "Error reconnecting to sparclet.";
return -1;
@ -145,12 +145,12 @@ proc gdb_sparclet_startup { } {
set timeout 1200
verbose "Timeout is now $timeout seconds" 2
expect {
-i $gdb_spawn_id -re "Loading.*$prompt $" {
-i $gdb_spawn_id -re "Loading.*$gdb_prompt $" {
verbose "Loaded $loader into $GDB" 1
set timeout 60
verbose "Timeout is now $timeout seconds" 2
}
-i $gdb_spawn_id -re "$prompt $" {
-i $gdb_spawn_id -re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
@ -193,7 +193,7 @@ proc gdb_sparclet_startup { } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Running loader succeeded"
}
-i $gdb_spawn_id timeout {
@ -213,12 +213,12 @@ proc gdb_sparclet_startup { } {
proc gdb_run_cmd { args } {
global gdb_spawn_id
global prompt
global gdb_prompt
gdb_breakpoint exit;
send_gdb "set \$fp=0\n";
expect {
-i $gdb_spawn_id -re ".*$prompt" { }
-i $gdb_spawn_id -re ".*$gdb_prompt" { }
}
send_gdb "jump start\n";
expect {
@ -243,7 +243,7 @@ proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global prompt
global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
@ -267,8 +267,8 @@ proc gdb_load { arg } {
send_gdb "y\n"
exp_continue
}
-i $gdb_spawn_id -re "Reading symbols from.*done..*$prompt $" {}
-i $gdb_spawn_id -re "$prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id -re "Reading symbols from.*done..*$gdb_prompt $" {}
-i $gdb_spawn_id -re "$gdb_prompt $" { perror "GDB couldn't read file" }
-i $gdb_spawn_id timeout {
perror "(timeout) read symbol file" ;
return -1
@ -282,7 +282,7 @@ proc gdb_load { arg } {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" {
-i $gdb_spawn_id -re ".*$gdb_prompt $" {
verbose "Set remote target to [target_info serial]" 2
}
-i $gdb_spawn_id timeout {
@ -303,12 +303,12 @@ proc gdb_load { arg } {
set timeout 1200
verbose "Timeout is now $timeout seconds" 2
expect {
-i $gdb_spawn_id -re "Loading.*$prompt $" {
-i $gdb_spawn_id -re "Loading.*$gdb_prompt $" {
verbose "Loaded $arg into $GDB" 1
set timeout 60
verbose "Timeout is now $timeout seconds" 2
}
-i $gdb_spawn_id -re "$prompt $" {
-i $gdb_spawn_id -re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
@ -321,7 +321,7 @@ proc gdb_load { arg } {
}
send_gdb "list main\n";
expect {
-i $gdb_spawn_id -re ".*$prompt" { }
-i $gdb_spawn_id -re ".*$gdb_prompt" { }
-i $gdb_spawn_id default {
perror "command for list main never completed";
return -1;

View File

@ -27,7 +27,7 @@ load_lib gdb.exp
# Set gdb to the desired UDI target
#
proc gdb_target_udi { } {
global prompt
global gdb_prompt
global verbose
global exit_status
@ -40,7 +40,7 @@ proc gdb_target_udi { } {
-re "target udi $targetname\[\r\n\]+" {
exp_continue
}
-re "TIP UDI 1.2 Conformant.*$prompt $" {
-re "TIP UDI 1.2 Conformant.*$gdb_prompt $" {
verbose "Set target to $targetname"
}
-re "TIP-ipc WARNING,.*failed:" {
@ -73,7 +73,7 @@ proc gdb_load { arg } {
global loadpath
global loadfile
global GDB
global prompt
global gdb_prompt
if [gdb_file_cmd $arg] {
return -1

View File

@ -27,7 +27,7 @@ load_lib gdb.exp
load_lib vxworks.exp
set shell_prompt "->"
set prompt "\\(vxgdb\\)"
set gdb_prompt "\\(vxgdb\\)"
#
# gdb_version -- extract and print the version number of gcc
@ -57,7 +57,7 @@ proc gdb_load { arg } {
# gdb_start -- start gdb running
#
proc gdb_start { } {
global prompt
global gdb_prompt
global verbose
global connectmode
global reboot
@ -100,7 +100,7 @@ proc gdb_start { } {
}
proc spawn_vxgdb { } {
global prompt
global gdb_prompt
global verbose
default_gdb_start
@ -108,7 +108,7 @@ proc spawn_vxgdb { } {
# set the default arguments to "main", so that "run" with no
# arguments will work correctly.
send "set args main\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
verbose "Setting up target, Please wait..."
# set targets hostname
@ -116,7 +116,7 @@ proc spawn_vxgdb { } {
set timeout 60
verbose "Timeout is now $timeout seconds" 2
expect {
-re "Done\..*$prompt $" {
-re "Done\..*$gdb_prompt $" {
verbose "Set target to [target_info netport]" 1
}
-re "net_connect: RPC: Program not registered.*$" {

View File

@ -46,7 +46,7 @@ if [istarget "m68k*-*-hpux*"] then {
# to a line that we know is always executed.
proc do_steps_and_nexts {} {
global prompt
global gdb_prompt
global srcdir
gdb_reinitialize_dir $srcdir/..
@ -54,87 +54,87 @@ proc do_steps_and_nexts {} {
for {set count 0} {$count < 20} {incr count} {
send "list\n"
expect {
-re ".*symarg = NULL.*$prompt $" {
-re ".*symarg = NULL.*$gdb_prompt $" {
set description "step over symarg initialization"
set command "step"
}
-re ".*execarg = NULL.*$prompt $" {
-re ".*execarg = NULL.*$gdb_prompt $" {
set description "step over execarg initialization"
set command "step"
}
-re ".*corearg = NULL.*$prompt $" {
-re ".*corearg = NULL.*$gdb_prompt $" {
set description "step over corearg initialization"
set command "step"
}
-re ".*cdarg = NULL.*$prompt $" {
-re ".*cdarg = NULL.*$gdb_prompt $" {
set description "step over cdarg initialization"
set command "step"
}
-re ".*ttyarg = NULL.*$prompt $" {
-re ".*ttyarg = NULL.*$gdb_prompt $" {
set description "step over ttyarg initialization"
set command "step"
}
-re ".*time_at_startup = get_run_time.*$prompt $" {
-re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
set description "next over get_run_time and everything it calls"
set command "next"
}
-re ".*START_PROGRESS.*$prompt $" {
-re ".*START_PROGRESS.*$gdb_prompt $" {
set description "next over START_PROGRESS and everything it calls"
set command "next"
}
-re ".*mac_init.*$prompt $" {
-re ".*mac_init.*$gdb_prompt $" {
set description "next over mac_init and everything it calls"
set command "next"
}
-re ".*init_malloc.*$prompt $" {
-re ".*init_malloc.*$gdb_prompt $" {
set description "next over init_malloc and everything it calls"
set command "next"
}
-re ".*count . 0x3.*$prompt $" {
-re ".*count . 0x3.*$gdb_prompt $" {
set description "next over conditional stack alignment code 1"
set command "next"
}
-re ".*if .i != 0.*$prompt $" {
-re ".*if .i != 0.*$gdb_prompt $" {
set description "next over conditional stack alignment code 2"
set command "next"
}
-re ".*alloca .i - 4.*$prompt $" {
-re ".*alloca .i - 4.*$gdb_prompt $" {
set description "next over conditional stack alignment alloca"
set command "next"
}
-re ".*SET_TOP_LEVEL.*$prompt $" {
-re ".*SET_TOP_LEVEL.*$gdb_prompt $" {
set description "next over SET_TOP_LEVEL call"
set command "next"
}
-re ".*cmdsize = 1.*$prompt $" {
-re ".*cmdsize = 1.*$gdb_prompt $" {
set description "step over cmdsize initialization"
set command "next"
}
-re ".*cmdarg = .* xmalloc.*$prompt $" {
-re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
set description "next over cmdarg initialization via xmalloc"
set command "next"
}
-re ".*ncmd = 0.*$prompt $" {
-re ".*ncmd = 0.*$gdb_prompt $" {
set description "next over ncmd initialization"
set command "next"
}
-re ".*dirsize = 1.*$prompt $" {
-re ".*dirsize = 1.*$gdb_prompt $" {
set description "next over dirsize initialization"
set command "next"
}
-re ".*dirarg = .* xmalloc.*$prompt $" {
-re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
return
}
-re "\[ \t\]+\{\r\n$prompt $" {
-re "\[ \t\]+\{\r\n$gdb_prompt $" {
setup_xfail "mips-*-irix5*"
fail "$description ended up at odd location"
}
-re ".*main.c.*No such file or directory.*$prompt $" {
-re ".*main.c.*No such file or directory.*$gdb_prompt $" {
setup_xfail "rs6000-*-aix3*"
fail "must be able to list source lines"
return
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "unknown source line after $description"
return
}
@ -145,13 +145,13 @@ proc do_steps_and_nexts {} {
}
send "$command\n"
expect {
-re ".*No such file or directory.\r\n$prompt $" {
-re ".*No such file or directory.\r\n$gdb_prompt $" {
fail "$description (no source available)"
}
-re ".*A file or directory .* does not exist..\r\n$prompt $" {
-re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" {
fail "$description (no source available)"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
pass "$description"
}
timeout {
@ -162,7 +162,7 @@ proc do_steps_and_nexts {} {
}
proc test_with_self { executable } {
global prompt
global gdb_prompt
global tool
global det_file
global decimal
@ -221,19 +221,19 @@ proc test_with_self { executable } {
set description "run until breakpoint at main"
send "run -nw\n"
expect {
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$prompt $" {
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" {
pass "$description"
}
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$prompt $" {
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$gdb_prompt $" {
xfail "$description (line numbers scrambled?)"
}
-re "vfork: No more processes.*$prompt $" {
-re "vfork: No more processes.*$gdb_prompt $" {
fail "$description (out of virtual memory)"
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
return -1
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "$description"
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
@ -250,13 +250,13 @@ proc test_with_self { executable } {
# do we have a version number ?
send "print version\n"
expect {
-re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$prompt $" {
-re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" {
pass "printed version"
}
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$prompt $" {
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
pass "printed version with cast"
}
-re ".*$prompt $" { fail "printed version" }
-re ".*$gdb_prompt $" { fail "printed version" }
timeout { fail "(timeout) printed version" }
}
@ -273,16 +273,16 @@ proc test_with_self { executable } {
set description "step into xmalloc call"
send "step\n"
expect {
-re "xmalloc.*size=.*at.*utils.c.*$prompt $" {
-re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
pass "$description"
}
-re ".*No such file or directory.\r\n$prompt $" {
-re ".*No such file or directory.\r\n$gdb_prompt $" {
pass "$description (no source available)"
}
-re "A file or directory .* does not exist..\r\n$prompt $" {
-re "A file or directory .* does not exist..\r\n$gdb_prompt $" {
pass "$description (no source available)"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "$description"
}
timeout {
@ -299,14 +299,14 @@ GDB is free software, covered by the GNU General Public License, and you are.*
welcome to change it and/or distribute copies of it under certain conditions.*
Type \"show copying\" to see the conditions.*
There is absolutely no warranty for GDB. Type \"show warranty\" for details.*
This GDB was configured as .*$prompt $"\
This GDB was configured as .*$gdb_prompt $"\
{ pass "xgdb is at prompt" }
-re "GDB is free software and you are welcome to distribute copies of it.*
under certain conditions; type \"show copying\" to see the conditions..*
There is absolutely no warranty for GDB; type \"show warranty\" for details..*
GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\
GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\
{ pass "xgdb is at prompt (obsolescent gdb)" }
-re ".*$prompt $" { fail "xgdb is at prompt" }
-re ".*$gdb_prompt $" { fail "xgdb is at prompt" }
timeout { fail "(timeout) xgdb is at prompt" }
}
@ -314,7 +314,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\
send "set prompt (xgdb) \n"
expect {
-re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" }
-re ".*$prompt $" { fail "Set xgdb prompt" }
-re ".*$gdb_prompt $" { fail "Set xgdb prompt" }
default { fail "(timeout) Set xgdb prompt" }
}
@ -322,10 +322,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\
set description "send ^C to child process"
send "\003"
expect {
-re "Program received signal SIGINT.*$prompt $" {
-re "Program received signal SIGINT.*$gdb_prompt $" {
pass "$description"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "$description"
}
timeout {
@ -336,10 +336,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\
set description "send SIGINT signal to child process"
send "signal SIGINT\n"
expect {
-re "Continuing with signal SIGINT.*$prompt $" {
-re "Continuing with signal SIGINT.*$gdb_prompt $" {
pass "$description"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "$description"
}
timeout {
@ -356,10 +356,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\
set description "backtrace through signal handler"
send "backtrace\n"
expect {
-re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$prompt $" {
-re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" {
pass "$description"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
# On the alpha, we hit the infamous problem about gdb
# being unable to get the frame pointer (mentioned in
# gdb/README). As it is intermittent, there is no way to

View File

@ -74,13 +74,13 @@ if [istarget "*-*-vxworks*"] then {
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
expect {
-re ".*usage: factorial <number>.*Program exited with code 01.*$prompt $" {
-re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
pass "run \"$testfile\" with no args"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run \"$testfile\" with no args"
verbose "expect_out is $expect_out(buffer)" 2
}
@ -108,14 +108,14 @@ if [istarget "*-*-vxworks*"] then {
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
setup_xfail "mips-idt-*"
gdb_run_cmd 5
expect {
-re ".*120.*$prompt $"\
-re ".*120.*$gdb_prompt $"\
{ pass "run \"$testfile\" with arg" }
-re ".*$prompt $" { fail "run \"$testfile\" with arg" }
-re ".*$gdb_prompt $" { fail "run \"$testfile\" with arg" }
timeout { fail "(timeout) run \"$testfile\" with arg" }
}
}
@ -136,12 +136,12 @@ if [istarget "*-*-vxworks*"] then {
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
expect {
-re ".*120.*$prompt $"\
-re ".*120.*$gdb_prompt $"\
{ pass "run \"$testfile\" again with same args" }
-re ".*$prompt $" { fail "run \"$testfile\" again with same args" }
-re ".*$gdb_prompt $" { fail "run \"$testfile\" again with same args" }
timeout { fail "(timeout) run \"$testfile\" again with same args" }
}
}
@ -152,7 +152,7 @@ if [istarget "*-*-vxworks*"] then {
} else {
send_gdb "set args\n"
}
expect -re "$prompt $"
expect -re "$gdb_prompt $"
gdb_run_cmd
@ -172,13 +172,13 @@ if [istarget "*-*-vxworks*"] then {
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
expect {
-re ".*usage: factorial <number>.*$prompt $" {
-re ".*usage: factorial <number>.*$gdb_prompt $" {
pass "run after setting args to nil"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run after setting args to nil"
}
timeout {
@ -194,7 +194,7 @@ if [istarget "*-*-vxworks*"] then {
} else {
send_gdb "set args 6\n"
}
expect -re "$prompt $"
expect -re "$gdb_prompt $"
gdb_run_cmd
if [istarget "*-*-vxworks*"] then {
@ -213,13 +213,13 @@ if [istarget "*-*-vxworks*"] then {
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
expect {
-re ".*720.*$prompt $" {
-re ".*720.*$gdb_prompt $" {
pass "run \"$testfile\" again after setting args"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run \"$testfile\" again after setting args"
}
timeout {
@ -233,10 +233,10 @@ if [istarget "*-*-vxworks*"] then {
if [isnative] then {
send_gdb "run `echo 8`\n"
expect {
-re "Starting program.*40320.*$prompt $" {
-re "Starting program.*40320.*$gdb_prompt $" {
pass "run \"$testfile\" with shell"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run \"$testfile\" with shell"
}
timeout {
@ -248,5 +248,5 @@ if [isnative] then {
# Reset the default arguments for VxWorks
if [istarget "*-*-vxworks*"] then {
send_gdb "set args main\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
}

View File

@ -61,14 +61,14 @@ expect {
-i $gdb_spawn_id -re "Delete all breakpoints.*$" {
send_gdb "y\n"
expect {
-re "$prompt $" {
-re "$gdb_prompt $" {
setup_xfail "i*86-*-sysv4*" "sparc-sun-sunos4*" "alpha-dec-osf*" "mips-dec-ultrix*"
fail "Delete all breakpoints when none (unexpected prompt)"
}
timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" }
}
}
-i $gdb_spawn_id -re ".*$prompt $" { pass "Delete all breakpoints when none" }
-i $gdb_spawn_id -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" }
timeout { fail "Delete all breakpoints when none (timeout)" }
}
@ -151,9 +151,9 @@ if ![target_info exists use_gdb_stub] {
send_gdb "y\n"
exp_continue
}
-re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$prompt $"\
-re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$gdb_prompt $"\
{ pass "run until function breakpoint" }
-re ".*$prompt $" { fail "run until function breakpoint" }
-re ".*$gdb_prompt $" { fail "run until function breakpoint" }
timeout { fail "run until function breakpoint (timeout)" }
}
} else {
@ -204,8 +204,8 @@ gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*"
#
send_gdb "tbreak 64\n"
expect {
-re "Breakpoint.*at.* file .*$srcfile, line 64.*$prompt $" { pass "Temporary breakpoint line number" }
-re ".*$prompt $" { pass "Temporary breakpoint line number" }
-re "Breakpoint.*at.* file .*$srcfile, line 64.*$gdb_prompt $" { pass "Temporary breakpoint line number" }
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number" }
timeout { fail "breakpoint line number (timeout)" }
}
@ -216,8 +216,8 @@ gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary br
#
send_gdb "tbreak $srcfile:70\n"
expect {
-re "Breakpoint.*at.* file .*$srcfile, line 70.*$prompt $" { pass "Temporary breakpoint line number in file" }
-re ".*$prompt $" { pass "Temporary breakpoint line number in file" }
-re "Breakpoint.*at.* file .*$srcfile, line 70.*$gdb_prompt $" { pass "Temporary breakpoint line number in file" }
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file" }
timeout { fail "Temporary breakpoint line number in file (timeout)" }
}
@ -242,7 +242,7 @@ proc test_clear_command {} {
#
proc test_next_with_recursion {} {
global prompt
global gdb_prompt
global decimal
global noresults
global binfile
@ -272,7 +272,7 @@ proc test_next_with_recursion {} {
gdb_run_cmd
}
expect {
-re "Break.* factorial .value=6. .*$prompt $" {}
-re "Break.* factorial .value=6. .*$gdb_prompt $" {}
timeout { fail "run to factorial(6) (timeout)" ; return }
}
@ -280,7 +280,7 @@ proc test_next_with_recursion {} {
send_gdb "continue\n"
expect {
-re "Continuing.*Break.* factorial .value=5. .*$prompt $" {}
-re "Continuing.*Break.* factorial .value=5. .*$gdb_prompt $" {}
timeout { fail "continue to factorial(5) (timeout)" ; return }
}
@ -296,7 +296,7 @@ proc test_next_with_recursion {} {
send_gdb "next\n"
expect {
-re ".* factorial .value - 1.;.*$prompt $" {}
-re ".* factorial .value - 1.;.*$gdb_prompt $" {}
timeout { fail "next to recursive call (timeout)" ; return }
}
@ -341,5 +341,5 @@ if [istarget "*-*-vxworks*"] {
set timeout 10
verbose "Timeout is now $timeout seconds" 2
send_gdb "set args main\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
}

View File

@ -60,21 +60,21 @@ if [target_info exists gdb,cannot_call_functions] {
# fails, then we skip the other tests.
proc set_lang_c {} {
global prompt
global gdb_prompt
send_gdb "set language c\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language c (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"c\".*$prompt $" {
-re ".* source language is \"c\".*$gdb_prompt $" {
pass "set language to \"c\""
return 1
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"c\""
return 0
}

View File

@ -65,7 +65,7 @@ if [istarget "a29k-*-*"] then {
proc bfddefault {} {
global GDB
global GDBFLAGS
global prompt
global gdb_prompt
global objdir
global subdir
global binfile
@ -80,21 +80,21 @@ proc bfddefault {} {
send_gdb "y\n"
exp_continue
}
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$prompt $" {
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" {
pass "$binfile ($bfdformat) auto format"
}
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+.no debugging symbols found.\[.\]+done\..*$prompt $" {
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+.no debugging symbols found.\[.\]+done\..*$gdb_prompt $" {
pass "$binfile ($bfdformat) auto format (but no symbols found)"
}
-re "File format not recognized.*$prompt $" {
-re "File format not recognized.*$gdb_prompt $" {
fail "$binfile ($bfdformat) auto format (format not recognized)"
return
}
-re "File format is ambiguous.*$prompt $" {
-re "File format is ambiguous.*$gdb_prompt $" {
fail "$binfile ($bfdformat) auto format (format is ambiguous)"
return
}
-re "$prompt $" {
-re "$gdb_prompt $" {
fail "$binfile ($bfdformat) auto format"
return
}
@ -117,7 +117,7 @@ proc bfddefault {} {
proc bfdexplicit {} {
global GDB
global GDBFLAGS
global prompt
global gdb_prompt
global subdir
global objdir
global det_file
@ -141,14 +141,14 @@ proc bfdexplicit {} {
send_gdb "y\n"
exp_continue
}
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$prompt $" {
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" {
pass "$binfile ($bfdformat) explicit format"
}
-re "Invalid target.*$prompt $" {
-re "Invalid target.*$gdb_prompt $" {
fail "$binfile ($bfdformat) explicit format (invalid target)"
return
}
-re "$prompt $" {
-re "$gdb_prompt $" {
fail "$binfile ($bfdformat) explicit format"
return
}
@ -162,13 +162,13 @@ proc bfdexplicit {} {
}
proc test_ptype_functions {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
global det_file
send_gdb "ptype main\n"
expect {
-re "type = int \[)(\]+\r\n$prompt $" {}
-re "type = int \[)(\]+\r\n$gdb_prompt $" {}
timeout { fail "(timeout) $binfile ($bfdformat) function main" ; return }
}
@ -192,7 +192,7 @@ proc test_ptype_functions {} {
# Note that plain chars can be either signed or unsigned.
proc test_ptype_plain_types {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
@ -217,7 +217,7 @@ proc test_ptype_plain_types {} {
# defined away and the variables default to plain types. So accept either.
proc test_ptype_signed_types {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
global det_file
@ -241,7 +241,7 @@ proc test_ptype_signed_types {} {
}
proc test_ptype_unsigned_types {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
global det_file
@ -266,7 +266,7 @@ proc test_ptype_unsigned_types {} {
# Note that plain chars can be either signed or unsigned.
proc test_ptype_array_types {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
global det_file
@ -290,7 +290,7 @@ proc test_ptype_array_types {} {
}
proc test_ptype_pointer_types {} {
global prompt
global gdb_prompt
global binfile
global bfdformat
global det_file
@ -316,7 +316,7 @@ proc loadandtest { args } {
global verbose
global GDB
global GDBFLAGS
global prompt
global gdb_prompt
global subdir
global objdir
global binfile

View File

@ -16,17 +16,17 @@ gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "a
setup_xfail "mips-idt-*"
send_gdb "attach\n"
expect {
-re "Argument required .(process-id|program) to attach.*$prompt $"\
-re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
{ pass "attach" }
-re "You can't do that when your target is `None'.*$prompt $"\
-re "You can't do that when your target is `None'.*$gdb_prompt $"\
{ pass "attach" }
-re "Don't know how to attach. Try \"help target\"..*$prompt $"\
-re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\
{ pass "attach" }
-re "Kill it. .y or n." {
send_gdb "y\n"
exp_continue
}
-re "$prompt $" { fail "attach" }
-re "$gdb_prompt $" { fail "attach" }
timeout { fail "(timeout) attach" }
}
@ -103,7 +103,7 @@ expect {
-re "Delete all auto-display expressions.*y or n. $" {
send_gdb "y\n"
expect {
-re "$prompt $" { pass "delete display prompt" }
-re "$gdb_prompt $" { pass "delete display prompt" }
timeout { fail "(timeout) delete display prompt" }
}
}
@ -132,7 +132,7 @@ expect {
-re "Reinitialize source path to empty.*y or n. $" {
send_gdb "y\n"
expect {
-re "Source directories searched: .cdir:.cwd.*$prompt $"\
-re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\
{ pass "directory prompt" }
timeout { fail "(timeout) directory prompt" }
}
@ -180,7 +180,7 @@ gdb_test "enable" "" "enable"
#test exec-file
send_gdb "exec-file\n"
expect {
-re "No exec file now..*$prompt $" {
-re "No exec file now..*$gdb_prompt $" {
pass "exec-file"
}
-re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
@ -188,10 +188,10 @@ expect {
if $verbose>1 then {
send_user "\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
expect -re "$gdb_prompt $" { }
pass "exec-file"
}
-re "$prompt $" { fail "exec-file" }
-re "$gdb_prompt $" { fail "exec-file" }
timeout { fail "(timeout) exec-file" }
}
@ -208,17 +208,17 @@ gdb_test "fg" "The program is not being run." "fg"
#test file
send_gdb "file\n"
expect {
-re "No exec file now..*$prompt $"\
-re "No exec file now..*$gdb_prompt $"\
{ pass "file" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
expect -re "$gdb_prompt $" { }
pass "file"
}
-re ".*$prompt $" { fail "file" }
-re ".*$gdb_prompt $" { fail "file" }
timeout { fail "(timeout) file" }
}
@ -351,31 +351,31 @@ gdb_test "pwd" "Working directory .*" "pwd"
#test run "r" abbreviation
if [istarget "*-*-vxworks*"] then {
send_gdb "set args\n"
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
gdb_test "r" "Starting program: .*
You must specify a function name to run, and arguments if any"\
"run \"r\" abbreviation"
send_gdb "set args main\n"
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
send_gdb "r\n"
expect {
-re "Starting program: .*
You can't do that when your target is `None'.*$prompt $"\
You can't do that when your target is `None'.*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Starting program: .*
No executable file specified.*
Use the \"file\" or \"exec-file\" command.*$prompt $"\
Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Starting program: .*
No image loaded into target.*$prompt $"\
No image loaded into target.*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Starting program: .*
No program loaded.*$prompt $"\
No program loaded.*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Don't know how to run. Try \"help target\"..*$prompt $"\
-re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re ".*$prompt $" { fail "run \"r\" abbreviation" }
-re ".*$gdb_prompt $" { fail "run \"r\" abbreviation" }
timeout { fail "(timeout) run \"r\" abbreviation" }
}
}
@ -383,28 +383,28 @@ No program loaded.*$prompt $"\
#test run
if [istarget "*-*-vxworks*"] then {
send_gdb "set args\n"
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
gdb_test "run" "Starting program: .*
You must specify a function name to run, and arguments if any"
send_gdb "set args main\n"
expect -re "$prompt $" {}
expect -re "$gdb_prompt $" {}
} else {
send_gdb "run\n"
expect {
-re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" }
-re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" }
-re "Starting program: .*
No executable file specified.*
Use the \"file\" or \"exec-file\" command.*$prompt $"\
Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
{ pass "run" }
-re "Starting program: .*
No image loaded into target.*$prompt $"\
No image loaded into target.*$gdb_prompt $"\
{ pass "run" }
-re "Starting program: .*
No program loaded.*$prompt $"\
No program loaded.*$gdb_prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Don't know how to run. Try \"help target\"..*$prompt $"\
-re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
{ pass "run" }
-re ".*$prompt $" { fail "run" }
-re ".*$gdb_prompt $" { fail "run" }
timeout { fail "(timeout) run" }
}
}
@ -417,13 +417,13 @@ gdb_test "rbreak" "" "rbreak"
# an initial stack to be created.
send_gdb "return\n"
expect {
-re "No selected frame..*$prompt $"\
-re "No selected frame..*$gdb_prompt $"\
{ pass "return" }
-re "Make .* return now.*y or n. $" {
send_gdb "y\n"
exp_continue
}
-re ".*$prompt $" { fail "return" }
-re ".*$gdb_prompt $" { fail "return" }
timeout { fail "(timeout) return" }
}
@ -594,10 +594,10 @@ gdb_test "show print union" "Printing of unions interior to structures is on." "
#test show print vtbl
gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"
#test show prompt
# In the FAIL case, can't just look for $prompt because that will match
# the output, rather than the prompt. So look for $prompt at the start
# In the FAIL case, can't just look for $gdb_prompt because that will match
# the output, rather than the prompt. So look for $gdb_prompt at the start
# of a line.
gdb_test "show prompt" "Gdb's prompt is \"$prompt \".*" "show prompt"
gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt"
#test show radix
gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"
#test show symbol-reloading
@ -647,34 +647,34 @@ gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.
#test target core
send_gdb "target core\n"
expect {
-re "No core file specified..*$prompt $" { pass "target core" }
-re "No core file specified..*$gdb_prompt $" { pass "target core" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
expect -re "$gdb_prompt $" { }
pass "target core"
}
-re "Undefined target command: \"core\". Try \"help target\"..*$prompt $" { pass "target core" }
-re ".*$prompt $" { fail "target core" }
-re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" }
-re ".*$gdb_prompt $" { fail "target core" }
timeout { fail "(timeout) target core" }
}
#test target exec
send_gdb "target exec\n"
expect {
-re "No exec file now..*$prompt $"\
-re "No exec file now..*$gdb_prompt $"\
{ pass "target exec" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
expect -re "$gdb_prompt $" { }
pass "target exec"
}
-re ".*$prompt $" { fail "target exec" }
-re ".*$gdb_prompt $" { fail "target exec" }
timeout { fail "(timeout) target exec" }
}
@ -683,17 +683,17 @@ if ![istarget "*-*-udi*"] then {
send_gdb "target remote\n"
expect {
-re "To open a remote debug connection, you need to specify what serial.*
device is attached to the remote system .e.g. /dev/ttya.*$prompt $"\
device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\
{ pass "target remote" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
expect -re "$gdb_prompt $" { }
pass "target remote"
}
-re ".*$prompt $" { fail "target remote" }
-re ".*$gdb_prompt $" { fail "target remote" }
timeout { fail "(timeout) target remote" }
}
}
@ -717,7 +717,7 @@ expect {
-re "Delete all auto-display expressions.*y or n. $" {
send_gdb "y\n"
expect {
-re "$prompt $" { pass "undisplay prompt" }
-re "$gdb_prompt $" { pass "undisplay prompt" }
timeout { fail "(timeout) (timeout) undisplay prompt" }
}
}
@ -730,7 +730,7 @@ expect {
-re "Delete all environment variables?.*y or n. $" {
send_gdb "y\n"
expect {
-re "$prompt $" { pass "unset environmentprompt" }
-re "$gdb_prompt $" { pass "unset environmentprompt" }
timeout {
fail "(timeout) (timeout) unset environment prompt"
}

View File

@ -282,7 +282,7 @@ gdb_test "help section" "Change the base address of section SECTION of the exec
#test help set annotate
gdb_test "help set annotate" "Set annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help set annotate"
# test help set args
gdb_test "help set args" "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$prompt $"
gdb_test "help set args" "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$gdb_prompt $"
gdb_test "help set args"
# test help set check "c" abbreviation
gdb_test "help set c" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"c\" abbreviation"
@ -374,7 +374,7 @@ gdb_test "help shell" "Execute the rest of the line as a shell command. .*\[\r\
#test help show annotate
gdb_test "help show annotate" "Show annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help show annotate"
# test help show args
gdb_test "help show args" "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$prompt $"
gdb_test "help show args" "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$gdb_prompt $"
gdb_test "help show args"
# test help show check "c" abbreviation
gdb_test "help show c" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check \"c\" abbreviation"

View File

@ -82,23 +82,23 @@ if ![file exists $binfile] then {
send_gdb "\003"
expect {
-re "Program received signal SIGINT.*$prompt $" {
-re "Program received signal SIGINT.*$gdb_prompt $" {
pass "send_gdb control C"
}
-re ".*$prompt $" { fail "send_gdb control C" }
-re ".*$gdb_prompt $" { fail "send_gdb control C" }
timeout { fail "send_gdb control C (timeout)" }
eof { fail "send_gdb control C (eof)" }
}
send_gdb "p func1 ()\n"
expect {
-re " = 4.*$prompt $" { pass "call function when asleep" }
-re ".*Program received signal SIGSEGV.*$prompt $" {
-re " = 4.*$gdb_prompt $" { pass "call function when asleep" }
-re ".*Program received signal SIGSEGV.*$gdb_prompt $" {
setup_xfail "i*86-pc-linux*-gnu"
fail "child died when we called func1, skipped rest of tests"
return
}
-re "$prompt $" { fail "call function when asleep (wrong output)" }
-re "$gdb_prompt $" { fail "call function when asleep (wrong output)" }
default {
# This fail probably happens whenever we use /proc (we
@ -137,7 +137,7 @@ if ![file exists $binfile] then {
expect {
-re "^continue\r\nContinuing.\r\n(\r\n|)$" { pass "continue" }
-re "^continue\r\n\r\n" { fail "continue (missing Continuing.)" }
-re "$prompt $" { fail "continue" }
-re "$gdb_prompt $" { fail "continue" }
timeout { fail "continue (timeout)" }
eof { fail "continue (eof)" }
}
@ -155,10 +155,10 @@ if ![file exists $binfile] then {
setup_xfail "i*86-pc-linux*-gnu"
send_gdb "\004"
expect {
-re "end of file.*Program exited normally.*$prompt $" {
-re "end of file.*Program exited normally.*$gdb_prompt $" {
pass "send_gdb end of file"
}
-re "$prompt $" { fail "send end of file" }
-re "$gdb_prompt $" { fail "send end of file" }
timeout { fail "send end of file (timeout)" }
eof { fail "send end of file (eof)" }
}

View File

@ -49,7 +49,7 @@ if [get_compiler_info ${binfile}] {
#
proc set_listsize { arg } {
global prompt
global gdb_prompt
if [gdb_test "set listsize $arg" "" "setting listsize to $arg"] {
return 0;
@ -69,7 +69,7 @@ proc set_listsize { arg } {
#
proc test_listsize {} {
global prompt
global gdb_prompt
# Show default size
@ -146,7 +146,7 @@ proc test_listsize {} {
#
proc test_list_include_file {} {
global prompt
global gdb_prompt
# FIXME Fails for COFF as well, I think.
setup_xfail "a29k-*-udi"
@ -162,40 +162,40 @@ proc test_list_include_file {} {
#
proc test_list_filename_and_number {} {
global prompt
global gdb_prompt
set testcnt 0
send_gdb "list list0.c:1\n"
expect {
-re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$prompt $" {
-re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list0.c:1" ; return }
-re ".*$gdb_prompt $" { fail "list list0.c:1" ; return }
timeout { fail "list list0.c:1 (timeout)" ; return }
}
send_gdb "list list0.c:10\n"
expect {
-re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$prompt $" {
-re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list.c:10" ; return }
-re ".*$gdb_prompt $" { fail "list list.c:10" ; return }
timeout { fail "list list.c:10 (timeout)" ; return }
}
send_gdb "list list1.c:1\n"
expect {
-re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list1.c:1" ; return }
-re ".*$gdb_prompt $" { fail "list list1.c:1" ; return }
timeout { fail "list list1.c:1 (timeout)" ; return }
}
send_gdb "list list1.c:12\n"
expect {
-re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$prompt $" {
-re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list1.c:12" ; return }
-re ".*$gdb_prompt $" { fail "list list1.c:12" ; return }
timeout { fail "list list1.c:12 (timeout)" ; return }
}
pass "list filename:number ($testcnt tests)"
@ -206,7 +206,7 @@ proc test_list_filename_and_number {} {
#
proc test_list_function {} {
global prompt
global gdb_prompt
global gcc_compiled
# gcc appears to generate incorrect debugging information for code
@ -227,35 +227,35 @@ proc test_list_function {} {
}
proc test_list_forward {} {
global prompt
global gdb_prompt
set testcnt 0
send_gdb "list list0.c:10\n"
expect {
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list list0.c:10" ; return }
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list list0.c:10" ; return }
timeout { fail "list list0.c:10 (timeout)" ; return }
}
send_gdb "list\n"
expect {
-re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 15-24" ; return }
-re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 15-24" ; return }
timeout { fail "list 15-24 (timeout)" ; return }
}
send_gdb "list\n"
expect {
-re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 25-34" ; return }
-re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 25-34" ; return }
timeout { fail "list 25-34 (timeout)" ; return }
}
send_gdb "list\n"
expect {
-re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 35-42" ; return }
-re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 35-42" ; return }
timeout { fail "list 35-42 (timeout)" ; return }
}
@ -263,35 +263,35 @@ proc test_list_forward {} {
}
proc test_list_backwards {} {
global prompt
global gdb_prompt
set testcnt 0
send_gdb "list list0.c:33\n"
expect {
-re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list list0.c:33" ; return }
-re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list list0.c:33" ; return }
timeout { fail "list list0.c:33 (timeout)" ; return }
}
send_gdb "list -\n"
expect {
-re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 18-27" ; return }
-re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 18-27" ; return }
timeout { fail "list 18-27 (timeout)" ; return }
}
send_gdb "list -\n"
expect {
-re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 8-17" ; return }
-re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 8-17" ; return }
timeout { fail "list 8-17 (timeout)" ; return }
}
send_gdb "list -\n"
expect {
-re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$prompt $" { incr testcnt }
-re ".*$prompt $" { fail "list 1-7" ; return }
-re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
-re ".*$gdb_prompt $" { fail "list 1-7" ; return }
timeout { fail "list 1-7 (timeout)" ; return }
}
@ -303,7 +303,7 @@ proc test_list_backwards {} {
#
proc test_list_range {} {
global prompt
global gdb_prompt
gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2"
@ -325,7 +325,7 @@ proc test_list_range {} {
#
proc test_list_filename_and_function {} {
global prompt
global gdb_prompt
set testcnt 0
@ -335,13 +335,13 @@ proc test_list_filename_and_function {} {
setup_xfail "a29k-*-udi"
send_gdb "list list0.c:main\n"
expect {
-re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$prompt $" {
-re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
pass "list function in source file 1"
}
-re ".*$prompt $" { fail "list list0.c:main" }
-re ".*$gdb_prompt $" { fail "list list0.c:main" }
timeout { fail "list list0.c:main (timeout)" }
}
@ -352,13 +352,13 @@ proc test_list_filename_and_function {} {
setup_xfail "rs6000-*-aix*"
send_gdb "list list0.c:unused\n"
expect {
-re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$prompt $" {
-re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$gdb_prompt $" {
incr testcnt
}
-re "37.*42\[ \t\]+\}\r\n$prompt $" {
-re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list0.c:unused" }
-re ".*$gdb_prompt $" { fail "list list0.c:unused" }
timeout { fail "list list0.c:unused (timeout)" }
}
clear_xfail "rs6000-*-aix*"
@ -373,19 +373,19 @@ proc test_list_filename_and_function {} {
setup_xfail "a29k-*-udi"
send_gdb "list list0.h:foo\n"
expect {
-re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
incr testcnt
}
-re "No source file named list0.h.\r\n$prompt $" {
-re "No source file named list0.h.\r\n$gdb_prompt $" {
fail "list list0.h:foo"
}
-re ".*$prompt $" { fail "list list0.h:foo" }
-re ".*$gdb_prompt $" { fail "list list0.h:foo" }
timeout { fail "list list0.h:foo (timeout)" }
}
@ -393,16 +393,16 @@ proc test_list_filename_and_function {} {
# a29k-amd-udi is the third case.
send_gdb "list list1.c:bar\n"
expect {
-re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$prompt $" {
-re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$gdb_prompt $" {
incr testcnt
}
-re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$prompt $" {
-re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
incr testcnt
}
-re "1\[ \t\]+void.*9\[ \t\]*\r\n$prompt $" {
-re "1\[ \t\]+void.*9\[ \t\]*\r\n$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list1.c:bar" }
-re ".*$gdb_prompt $" { fail "list list1.c:bar" }
timeout { fail "list list1.c:bar (timeout)" }
}
@ -413,13 +413,13 @@ proc test_list_filename_and_function {} {
setup_xfail "rs6000-*-aix*"
send_gdb "list list1.c:unused\n"
expect {
-re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$prompt $" {
-re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
incr testcnt
}
-re "9.*14\[ \t\]+\}\r\n.*$prompt $" {
-re "9.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list1.c:unused" }
-re ".*$gdb_prompt $" { fail "list list1.c:unused" }
timeout { fail "list list1.c:unused (timeout)" }
}
clear_xfail "rs6000-*-aix*"
@ -481,8 +481,8 @@ if [target_info exists use_gdb_stubs] {
send_gdb "step\n"
# if use stubs step out of the breakpoint() function.
expect {
-re "main.* at .*$prompt $" {}
-re ".*in .*start.*$prompt $" {}
-re "main.* at .*$gdb_prompt $" {}
-re ".*in .*start.*$gdb_prompt $" {}
timeout { fail "single step at breakpoint() (timeout)" ; return 0 }
}
}

View File

@ -38,7 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# fails, then we skip the other tests.
proc set_lang_c {} {
global prompt
global gdb_prompt
if [gdb_test "set language c" "" "set language c"] {
return 0
@ -51,7 +51,7 @@ proc set_lang_c {} {
}
proc test_integer_literals_accepted {} {
global prompt
global gdb_prompt
# Test various decimal values.
@ -79,7 +79,7 @@ proc test_integer_literals_accepted {} {
}
proc test_character_literals_accepted {} {
global prompt
global gdb_prompt
gdb_test "p 'a'" " = 97 'a'"
gdb_test "p/c 'a'" " = 97 'a'"
@ -95,7 +95,7 @@ proc test_character_literals_accepted {} {
}
proc test_integer_literals_rejected {} {
global prompt
global gdb_prompt
test_print_reject "p 0x"
gdb_test "p ''" "Empty character constant\\."
@ -129,7 +129,7 @@ proc test_integer_literals_rejected {} {
}
proc test_print_all_chars {} {
global prompt
global gdb_prompt
gdb_test "p ctable1\[0\]" " = 0 '\\\\000'"
gdb_test "p ctable1\[1\]" " = 1 '\\\\001'"
@ -393,7 +393,7 @@ proc test_print_all_chars {} {
# repeat count, set to the default of 10.
proc test_print_repeats_10 {} {
global prompt
global gdb_prompt
gdb_test "set print elements 1" ""
gdb_test "p &ctable2\[0*16\]" " = \\(unsigned char \\*\\) \"a\"..."
@ -781,7 +781,7 @@ proc test_print_repeats_10 {} {
}
proc test_print_strings {} {
global prompt
global gdb_prompt
# We accept "(unsigned char *) " before the string. char vs. unsigned char
# is already tested elsewhere.
@ -875,7 +875,7 @@ proc test_print_strings {} {
}
proc test_print_int_arrays {} {
global prompt
global gdb_prompt
gdb_test "set print elements 24" ""
@ -900,7 +900,7 @@ proc test_artificial_arrays {} {
}
proc test_print_char_arrays {} {
global prompt
global gdb_prompt
global hex
gdb_test "set print elements 24" ""
@ -925,7 +925,7 @@ proc test_print_char_arrays {} {
}
proc test_print_string_constants {} {
global prompt
global gdb_prompt
gdb_test "set print elements 50" ""

View File

@ -55,15 +55,15 @@ gdb_load ${binfile}
send_gdb "ptype red1\n"
expect {
-re "type = enum primary1_tag \{red1, green1, blue1\}.*$prompt $"\
-re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\
{
# The workaround is in effect. As this is a compiler, not GDB,
# bug, we'll make it a PASS but perhaps it should be an XFAIL.
pass "ptype unnamed enumeration member (worked around)"
}
-re "type = enum \{red1, green1, blue1\}.*$prompt $"\
-re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $"\
{ pass "ptype unnamed enumeration member" }
-re ".*$prompt $" { fail "ptype unnamed enumeration member" }
-re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" }
timeout { fail "(timeout) ptype unnamed enumeration member" }
}
@ -82,8 +82,8 @@ expect {
(long|long int|int) v_long_member;.*
float v_float_member;.*
double v_double_member;.*
\}.*$prompt $" { pass "ptype structure" }
-re ".*$prompt $" { fail "ptype structure" }
\}.*$gdb_prompt $" { pass "ptype structure" }
-re ".*$gdb_prompt $" { fail "ptype structure" }
timeout { fail "(timeout) ptype structure" }
}
@ -117,8 +117,8 @@ expect {
struct link \[*\]next;.*
struct link \[*(\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*
struct t_struct stuff.1..2..3.;.*
\}.*$prompt $" { pass "ptype linked list structure" }
-re ".*$prompt $" {
\}.*$gdb_prompt $" { pass "ptype linked list structure" }
-re ".*$gdb_prompt $" {
# IBM's xlc puts out bogus stabs--the stuff field is type 42,
# which isn't defined.
@ -141,8 +141,8 @@ expect {
(long|long int|int) v_long_member;.*
float v_float_member;.*
double v_double_member;.*
\}.*$prompt $" { pass "ptype union" }
-re ".*$prompt $" { fail "ptype union" }
\}.*$gdb_prompt $" { pass "ptype union" }
-re ".*$gdb_prompt $" { fail "ptype union" }
timeout { fail "(timeout) ptype union" }
}
@ -153,8 +153,8 @@ expect {
struct link \[*\]next;.*
struct link \[(\*\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*
struct t_struct stuff.1..2..3.;.*
\}.*$prompt $" { pass "ptype linked list union" }
-re ".*$prompt $" {
\}.*$gdb_prompt $" { pass "ptype linked list union" }
-re ".*$gdb_prompt $" {
# IBM's xlc puts out bogus stabs--the stuff field is type 42,
# which isn't defined.
@ -171,17 +171,17 @@ expect {
send_gdb "ptype primary\n"
expect {
-re "type = enum .red, green, blue.*$prompt $" { pass "ptype unnamed enumeration" }
-re ".*$prompt $" { fail "ptype unnamed enumeration" }
-re "type = enum .red, green, blue.*$gdb_prompt $" { pass "ptype unnamed enumeration" }
-re ".*$gdb_prompt $" { fail "ptype unnamed enumeration" }
timeout { fail "(timeout) ptype unnamed enumeration" }
}
send_gdb "ptype enum colors\n"
expect {
-re "type = enum colors \{yellow, purple, pink\}.*$prompt $"\
-re "type = enum colors \{yellow, purple, pink\}.*$gdb_prompt $"\
{ pass "ptype named enumeration" }
-re ".*$prompt $" { fail "ptype named enumeration" }
-re ".*$gdb_prompt $" { fail "ptype named enumeration" }
timeout { fail "(timeout) ptype named enumeration" }
}
@ -191,8 +191,8 @@ expect {
#
send_gdb "ptype boolean\n"
expect {
-re "type = enum \{FALSE, TRUE\}.*$prompt $" { pass "ptype unnamed typedef'd enumeration" }
-re ".*$prompt $" { fail "ptype unnamed typedef'd enumeration" }
-re "type = enum \{FALSE, TRUE\}.*$gdb_prompt $" { pass "ptype unnamed typedef'd enumeration" }
-re ".*$gdb_prompt $" { fail "ptype unnamed typedef'd enumeration" }
timeout { fail "(timeout) ptype unnamed typedef'd enumeration" }
}
@ -220,8 +220,8 @@ gdb_test "ptype t_union3" "type = union \{.*
send_gdb "ptype enum bvals\n"
expect {
-re "type = enum bvals \{false, true\}.*$prompt $" { pass "ptype named typedef'd enumf'd enum" }
-re ".*$prompt $" { fail "ptype named typedef'd enumeration" }
-re "type = enum bvals \{false, true\}.*$gdb_prompt $" { pass "ptype named typedef'd enumf'd enum" }
-re ".*$gdb_prompt $" { fail "ptype named typedef'd enumeration" }
timeout { fail "(timeout) ptype named typedef'd enumeration" }
}
@ -231,9 +231,9 @@ expect {
#
send_gdb "ptype enum misordered\n"
expect {
-re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$prompt $"\
-re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$gdb_prompt $"\
{ pass "ptype misordered enumeration" }
-re ".*$prompt $" { fail "ptype misordered enumeration" }
-re ".*$gdb_prompt $" { fail "ptype misordered enumeration" }
timeout { fail "(timeout) ptype misordered enumeration" }
}
@ -243,18 +243,18 @@ expect {
#
send_gdb "ptype three\n"
expect {
-re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$prompt $"\
-re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$gdb_prompt $"\
{ pass "ptype named enumeration member" }
-re ".*$prompt $" { fail "ptype named enumeration member" }
-re ".*$gdb_prompt $" { fail "ptype named enumeration member" }
timeout { fail "(timeout) ptype named enumeration member" }
}
send_gdb "ptype red\n"
expect {
-re "type = enum \{red, green, blue\}.*$prompt $"\
-re "type = enum \{red, green, blue\}.*$gdb_prompt $"\
{ pass "ptype unnamed enumeration member" }
-re ".*$prompt $" { fail "ptype unnamed enumeration member" }
-re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" }
timeout { fail "(timeout) ptype unnamed enumeration member" }
}
@ -271,8 +271,8 @@ expect {
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char\n"
#expect {
# -re "type = char.*$prompt $" { pass "ptype char" }
# -re ".*$prompt $" { fail "ptype char" }
# -re "type = char.*$gdb_prompt $" { pass "ptype char" }
# -re ".*$gdb_prompt $" { fail "ptype char" }
# timeout { fail "(timeout) ptype char" }
#}
#
@ -280,104 +280,104 @@ expect {
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char\n"
#expect {
# -re "type = signed char.*$prompt $" { pass "ptype signed char" }
# -re ".*$prompt $" { fail "ptype signed char" }
# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
# -re ".*$gdb_prompt $" { fail "ptype signed char" }
# timeout { fail "(timeout) ptype signed char" }
#}
#
#
#send "ptype v_unsigned_char\n"
#expect {
# -re "type = unsigned char.*$prompt $" { pass "ptype unsigned char" }
# -re ".*$prompt $" { fail "ptype unsigned char" }
# -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
# timeout { fail "(timeout) ptype unsigned char" }
#}
send_gdb "ptype v_short\n"
expect {
-re "type = short(| int).*$prompt $" { pass "ptype short" }
-re ".*$prompt $" { fail "ptype short" }
-re "type = short(| int).*$gdb_prompt $" { pass "ptype short" }
-re ".*$gdb_prompt $" { fail "ptype short" }
timeout { fail "(timeout) ptype short" }
}
#send "ptype v_signed_short\n"
#expect {
# -re "type = short.*$prompt $" { pass "ptype signed short" }
# -re ".*$prompt $" { fail "ptype signed short" }
# -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
# -re ".*$gdb_prompt $" { fail "ptype signed short" }
# timeout { fail "(timeout) ptype signed short" }
#}
#
#
#send "ptype v_unsigned_short\n"
#expect {
# -re "type = unsigned short.*$prompt $" { pass "ptype unsigned short" }
# -re ".*$prompt $" { fail "ptype unsigned short" }
# -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
# timeout { fail "(timeout) ptype unsigned short" }
#}
send_gdb "ptype v_int\n"
expect {
-re "type = int.*$prompt $" { pass "ptype int" }
-re ".*$prompt $" { fail "ptype int" }
-re "type = int.*$gdb_prompt $" { pass "ptype int" }
-re ".*$gdb_prompt $" { fail "ptype int" }
timeout { fail "(timeout) ptype int" }
}
#send "ptype v_signed_int\n"
#expect {
# -re "type = int.*$prompt $" { pass "ptype signed int" }
# -re ".*$prompt $" { fail "ptype signed int" }
# -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
# -re ".*$gdb_prompt $" { fail "ptype signed int" }
# timeout { fail "(timeout) ptype signed int" }
#}
#
#
#send "ptype v_unsigned_int\n"
#expect {
# -re "type = unsigned int.*$prompt $" { pass "ptype unsigned int" }
# -re ".*$prompt $" { fail "ptype unsigned int" }
# -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
# timeout { fail "(timeout) ptype unsigned int" }
#}
#
#
#send "ptype v_long\n"
#expect {
# -re "type = long.*$prompt $" { pass "ptype long" }
# -re ".*$prompt $" { fail "ptype long" }
# -re "type = long.*$gdb_prompt $" { pass "ptype long" }
# -re ".*$gdb_prompt $" { fail "ptype long" }
# timeout { fail "(timeout) ptype long" }
#}
#
#
#send "ptype v_signed_long\n"
#expect {
# -re "type = long.*$prompt $" { pass "ptype signed long" }
# -re ".*$prompt $" { fail "ptype signed long" }
# -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
# -re ".*$gdb_prompt $" { fail "ptype signed long" }
# timeout { fail "(timeout) ptype signed long" }
#}
#
#
#send "ptype v_unsigned_long\n"
#expect {
# -re "type = unsigned long.*$prompt $" { pass "ptype unsigned long" }
# -re ".*$prompt $" { fail "ptype unsigned long" }
# -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
# timeout { fail "(timeout) ptype unsigned long" }
#}
#
#
#send "ptype v_float\n"
#expect {
# -re "type = float.*$prompt $" { pass "ptype float" }
# -re ".*$prompt $" { fail "ptype float" }
# -re "type = float.*$gdb_prompt $" { pass "ptype float" }
# -re ".*$gdb_prompt $" { fail "ptype float" }
# timeout { fail "(timeout) ptype float" }
#}
#
#
#send "ptype v_double\n"
#expect {
# -re "type = double.*$prompt $" { pass "ptype double" }
# -re ".*$prompt $" { fail "ptype double" }
# -re "type = double.*$gdb_prompt $" { pass "ptype double" }
# -re ".*$gdb_prompt $" { fail "ptype double" }
# timeout { fail "(timeout) ptype double" }
#}
@ -389,8 +389,8 @@ expect {
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char_array\n"
#expect {
# -re "type = char .2..*$prompt $" { pass "ptype char array" }
# -re ".*$prompt $" { fail "ptype char array" }
# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
# -re ".*$gdb_prompt $" { fail "ptype char array" }
# timeout { fail "(timeout) ptype char array" }
#}
#
@ -398,16 +398,16 @@ expect {
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char_array\n"
#expect {
# -re "type = (|signed )char .2..*$prompt $" { pass "ptype signed char array" }
# -re ".*$prompt $" { fail "ptype signed char array" }
# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
# -re ".*$gdb_prompt $" { fail "ptype signed char array" }
# timeout { fail "(timeout) ptype signed char array" }
#}
#
#
#send "ptype v_unsigned_char_array\n"
#expect {
# -re "type = unsigned char .2..*$prompt $" { pass "ptype unsigned char array" }
# -re ".*$prompt $" { fail "ptype unsigned char array" }
# -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
# timeout { fail "(timeout) ptype unsigned char array" }
#}
#
@ -415,66 +415,66 @@ expect {
#
#send "ptype v_int_array\n"
#expect {
# -re "type = int .2..*$prompt $" { pass "ptype int array" }
# -re ".*$prompt $" { fail "ptype int array" }
# -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
# -re ".*$gdb_prompt $" { fail "ptype int array" }
# timeout { fail "(timeout) ptype int array" }
#}
#
#
#send "ptype v_signed_int_array\n"
#expect {
# -re "type = int .2..*$prompt $" { pass "ptype signed int array" }
# -re ".*$prompt $" { fail "ptype signed int array" }
# -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
# -re ".*$gdb_prompt $" { fail "ptype signed int array" }
# timeout { fail "(timeout) ptype signed int array" }
#}
#
#
#send "ptype v_unsigned_int_array\n"
#expect {
# -re "type = unsigned int .2..*$prompt $" { pass "ptype unsigned int array" }
# -re ".*$prompt $" { fail "ptype unsigned int array" }
# -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
# timeout { fail "(timeout) ptype unsigned int array" }
#}
#
#
#send "ptype v_long_array\n"
#expect {
# -re "type = (long|int|long int) .2..*$prompt $" {
# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
# pass "ptype long array" }
# -re ".*$prompt $" { fail "ptype long array" }
# -re ".*$gdb_prompt $" { fail "ptype long array" }
# timeout { fail "(timeout) ptype long array" }
#}
#
#
#send "ptype v_signed_long_array\n"
#expect {
# -re "type = (long|int|long int) .2..*$prompt $" {
# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
# pass "ptype signed long array" }
# -re ".*$prompt $" { fail "ptype signed long array" }
# -re ".*$gdb_prompt $" { fail "ptype signed long array" }
# timeout { fail "(timeout) ptype signed long array" }
#}
#
#
#send "ptype v_unsigned_long_array\n"
#expect {
# -re "type = unsigned long .2..*$prompt $" { pass "ptype unsigned long array" }
# -re ".*$prompt $" { fail "ptype unsigned long array" }
# -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
# timeout { fail "(timeout) ptype unsigned long array" }
#}
#
#
#send "ptype v_float_array\n"
#expect {
# -re "type = float .2..*$prompt $" { pass "ptype float array" }
# -re ".*$prompt $" { fail "ptype float array" }
# -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
# -re ".*$gdb_prompt $" { fail "ptype float array" }
# timeout { fail "(timeout) ptype float array" }
#}
#
#
#send "ptype v_double_array\n"
#expect {
# -re "type = double .2..*$prompt $" { pass "ptype double array" }
# -re ".*$prompt $" { fail "ptype double array" }
# -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
# -re ".*$gdb_prompt $" { fail "ptype double array" }
# timeout { fail "(timeout) ptype double array" }
#}
#
@ -490,8 +490,8 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char_pointer\n"
#expect {
# -re "type = char \*.*$prompt $" { pass "ptype char pointer" }
# -re ".*$prompt $" { fail "ptype char pointer" }
# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype char pointer" }
# timeout { fail "(timeout) ptype char pointer" }
#}
#
@ -499,105 +499,105 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char_pointer\n"
#expect {
# -re "type = (|signed )char \*.*$prompt $"
# -re "type = (|signed )char \*.*$gdb_prompt $"
# { pass "ptype signed char pointer" }
# -re ".*$prompt $" { fail "ptype signed char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
# timeout { fail "(timeout) ptype signed char pointer" }
#}
#
#
#send "ptype v_unsigned_char_pointer\n"
#expect {
# -re "type = unsigned char \*.*$prompt $" { pass "ptype unsigned char pointer" }
# -re ".*$prompt $" { fail "ptype unsigned char pointer" }
# -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
# timeout { fail "(timeout) ptype unsigned char pointer" }
#}
#
#
#send "ptype v_short_pointer\n"
#expect {
# -re "type = (short|short int) \*.*$prompt $" { pass "ptype short pointer" }
# -re ".*$prompt $" { fail "ptype short pointer" }
# -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype short pointer" }
# timeout { fail "(timeout) ptype short pointer" }
#}
#
#
#send "ptype v_signed_short_pointer\n"
#expect {
# -re "type = short \*.*$prompt $" { pass "ptype signed short pointer" }
# -re ".*$prompt $" { fail "ptype signed short pointer" }
# -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
# timeout { fail "(timeout) ptype signed short pointer" }
#}
#
#
#send "ptype v_unsigned_short_pointer\n"
#expect {
# -re "type = unsigned short \*.*$prompt $" { pass "ptype unsigned short pointer" }
# -re ".*$prompt $" { fail "ptype unsigned short pointer" }
# -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
# timeout { fail "(timeout) ptype unsigned short pointer" }
#}
#
#
#send "ptype v_int_pointer\n"
#expect {
# -re "type = int \*.*$prompt $" { pass "ptype int pointer" }
# -re ".*$prompt $" { fail "ptype int pointer" }
# -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype int pointer" }
# timeout { fail "(timeout) ptype int pointer" }
#}
#
#
#send "ptype v_signed_int_pointer\n"
#expect {
# -re "type = int \*.*$prompt $" { pass "ptype signed int pointer" }
# -re ".*$prompt $" { fail "ptype signed int pointer" }
# -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
# timeout { fail "(timeout) ptype signed int pointer" }
#}
#
#
#send "ptype v_unsigned_int_pointer\n"
#expect {
# -re "type = unsigned int \*.*$prompt $" { pass "ptype unsigned int pointer" }
# -re ".*$prompt $" { fail "ptype unsigned int pointer" }
# -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
# timeout { fail "(timeout) ptype unsigned int pointer" }
#}
#
#
#send "ptype v_long_pointer\n"
#expect {
# -re "type = long \*.*$prompt $" { pass "ptype long pointer" }
# -re ".*$prompt $" { fail "ptype long pointer" }
# -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype long pointer" }
# timeout { fail "(timeout) ptype long pointer" }
#}
#
#
#send "ptype v_signed_long_pointer\n"
#expect {
# -re "type = long \*.*$prompt $" { pass "ptype signed long pointer" }
# -re ".*$prompt $" { fail "ptype signed long pointer" }
# -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
# timeout { fail "(timeout) ptype signed long pointer" }
#}
#
#
#send "ptype v_unsigned_long_pointer\n"
#expect {
# -re "type = unsigned long \*.*$prompt $" { pass "ptype unsigned long pointer" }
# -re ".*$prompt $" { fail "ptype unsigned long pointer" }
# -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
# timeout { fail "(timeout) ptype unsigned long pointer" }
#}
#
#
#send "ptype v_float_pointer\n"
#expect {
# -re "type = float \*.*$prompt $" { pass "ptype float pointer" }
# -re ".*$prompt $" { fail "ptype float pointer" }
# -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
# -re ".*$gdb_prompt $" { fail "ptype float pointer" }
# timeout { fail "(timeout) ptype float pointer" }
#}
#
#
#send "ptype v_double_pointer\n"
#expect {
# -re "type = double \*.*$prompt $" { pass "ptype double pointer" }
# -re ".*$prompt $" { fail "ptype double pointer" }
# -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
# -re ".*$gdb_prompt $" { fail "ptype double pointer" }
# timeout { fail "(timeout) ptype double pointer" }
#}
@ -611,8 +611,8 @@ expect {
struct inner_struct inner_struct_instance;.*
union inner_union inner_union_instance;.*
(long|long int|int) outer_long;.*
\}.*$prompt $" { pass "ptype outer structure" }
-re ".*$prompt $" { fail "ptype outer structure" }
\}.*$gdb_prompt $" { pass "ptype outer structure" }
-re ".*$gdb_prompt $" { fail "ptype outer structure" }
timeout { fail "(timeout) ptype outer structure" }
}
@ -622,8 +622,8 @@ expect {
-re "type = struct inner_struct \{.*
int inner_int;.*
(long|long int|int) inner_long;.*
\}.*$prompt $" { pass "ptype inner structure" }
-re ".*$prompt $" { fail "ptype inner structure" }
\}.*$gdb_prompt $" { pass "ptype inner structure" }
-re ".*$gdb_prompt $" { fail "ptype inner structure" }
timeout { fail "(timeout) ptype inner structure" }
}
@ -633,8 +633,8 @@ expect {
-re "type = union inner_union \{.*
int inner_union_int;.*
(long|long int|int) inner_union_long;.*
\}.*$prompt $" { pass "ptype inner union" }
-re ".*$prompt $" { fail "ptype inner union" }
\}.*$gdb_prompt $" { pass "ptype inner union" }
-re ".*$gdb_prompt $" { fail "ptype inner union" }
timeout { fail "(timeout) ptype inner union" }
}
@ -646,16 +646,16 @@ expect {
struct inner_struct inner_struct_instance;.*
union inner_union inner_union_instance;.*
(long|long int|int) outer_long;.*
\}.*$prompt $" { pass "ptype nested structure" }
-re ".*$prompt $" { fail "ptype nested structure" }
\}.*$gdb_prompt $" { pass "ptype nested structure" }
-re ".*$gdb_prompt $" { fail "ptype nested structure" }
timeout { fail "(timeout) ptype nested structure" }
}
send_gdb "ptype nested_su.outer_int\n"
expect {
-re "type = int.*$prompt $" { pass "ptype outer int" }
-re ".*$prompt $" { fail "ptype outer int" }
-re "type = int.*$gdb_prompt $" { pass "ptype outer int" }
-re ".*$gdb_prompt $" { fail "ptype outer int" }
timeout { fail "(timeout) ptype outer int" }
}
@ -665,16 +665,16 @@ expect {
-re "type = struct inner_struct \{.*
int inner_int;.*
(long|long int|int) inner_long;.*
\}.*$prompt $" { pass "ptype nested structure" }
-re ".*$prompt $" { fail "ptype nested structure" }
\}.*$gdb_prompt $" { pass "ptype nested structure" }
-re ".*$gdb_prompt $" { fail "ptype nested structure" }
timeout { fail "(timeout) ptype nested structure" }
}
send_gdb "ptype nested_su.inner_struct_instance.inner_int\n"
expect {
-re "type = int.*$prompt $" { pass "ptype inner int" }
-re ".*$prompt $" { fail "ptype inner int" }
-re "type = int.*$gdb_prompt $" { pass "ptype inner int" }
-re ".*$gdb_prompt $" { fail "ptype inner int" }
timeout { fail "(timeout) ptype inner int" }
}
@ -684,8 +684,8 @@ expect {
-re "type = union inner_union \{.*
int inner_union_int;.*
(long|long int|int) inner_union_long;.*
\}.*$prompt $" { pass "ptype nested union" }
-re ".*$prompt $" { fail "ptype nested union" }
\}.*$gdb_prompt $" { pass "ptype nested union" }
-re ".*$gdb_prompt $" { fail "ptype nested union" }
timeout { fail "(timeout) ptype nested union" }
}

View File

@ -52,7 +52,7 @@ gdb_load $binfile
#
# set it up at a breakpoint so we canplay with the variable values
#
send_gdb "set print sevenbit-strings\n" ; expect -re "$prompt $"
send_gdb "set print sevenbit-strings\n" ; expect -re "$gdb_prompt $"
if ![runto_main] then {
perror "couldn't run to breakpoint"
@ -66,19 +66,19 @@ set ulong_minus_1 4294967295
set ulong_minus_456 4294966840
send_gdb "print sizeof (unsigned long)\n"
expect {
-re ".\[0-9\]* = 4.*$prompt $" {}
-re ".\[0-9\]* = 8.*$prompt $" {
-re ".\[0-9\]* = 4.*$gdb_prompt $" {}
-re ".\[0-9\]* = 8.*$gdb_prompt $" {
set ulong_minus_1 18446744073709551615
set ulong_minus_456 18446744073709551160
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "getting sizeof unsigned long"
}
default { fail "(timeout) getting sizeof unsigned long" }
}
proc test_set { args } {
global prompt
global gdb_prompt
set length [expr [llength $args] - 3];
set print_cmd "[lindex $args $length]";

View File

@ -44,7 +44,7 @@ set thissig "ABRT"
proc test_one_sig {nextsig} {
global sig_supported
global prompt
global gdb_prompt
global thissig
set this_sig_supported $sig_supported
@ -61,10 +61,10 @@ proc test_one_sig {nextsig} {
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
}
expect {
-re "Continuing.*Program received signal SIG$thissig.*$prompt $" {
-re "Continuing.*Program received signal SIG$thissig.*$gdb_prompt $" {
pass "get signal $thissig"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "get signal $thissig"
set need_another_continue 0
}
@ -95,10 +95,10 @@ proc test_one_sig {nextsig} {
setup_xfail "*-*-*lynx*"
}
expect {
-re "Breakpoint.*handle_$thissig.*$prompt $" {
-re "Breakpoint.*handle_$thissig.*$gdb_prompt $" {
pass "send signal $thissig"
}
-re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" {
-re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
fail "missed breakpoint at handle_$thissig"
set missed_handler 1
}
@ -108,15 +108,15 @@ proc test_one_sig {nextsig} {
if { $missed_handler == "0" } then {
send_gdb "signal 0\n"
expect {
-re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" {
-re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
pass "advance to $nextsig"
set sig_supported 1
}
-re "Breakpoint.*gen_$nextsig.*handle.*$prompt $" {
-re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
pass "advance to $nextsig"
set sig_supported 0
}
-re ".*$prompt $" { fail "advance to $nextsig" }
-re ".*$gdb_prompt $" { fail "advance to $nextsig" }
default { fail "advance to $nextsig (eof or timeout)" }
}
}

View File

@ -65,7 +65,7 @@ if [istarget "a29k-*-udi"] then {
proc do_function_calls {} {
global prototypes
global gcc_compiled
global prompt
global gdb_prompt
# First, call the "fun" functions and examine the value they return.
gdb_test "p fun1()" " = {a = 49 '1'}"
@ -129,9 +129,9 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
send_gdb "set print sevenbit-strings\n" ; expect -re "$prompt $"
send_gdb "set print address off\n" ; expect -re "$prompt $"
send_gdb "set width 0\n" ; expect -re "$prompt $"
send_gdb "set print sevenbit-strings\n" ; expect -re "$gdb_prompt $"
send_gdb "set print address off\n" ; expect -re "$gdb_prompt $"
send_gdb "set width 0\n" ; expect -re "$gdb_prompt $"
if [runto_main] then {
do_function_calls

View File

@ -51,42 +51,42 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# 3 Watchpoint ival3
proc initialize {} {
global prompt
global gdb_prompt
global hex
global decimal
global srcfile
send_gdb "break marker1\n"
expect {
-re "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*$prompt $" {
-re "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*$gdb_prompt $" {
pass "set breakpoint at marker1"
}
-re ".*$prompt $" { fail "set breakpoint at marker1" ; return 0 }
-re ".*$gdb_prompt $" { fail "set breakpoint at marker1" ; return 0 }
timeout { fail "set breakpoint at marker1 (timeout)" ; return 0 }
}
send_gdb "break marker2\n"
expect {
-re "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*$prompt $" {
-re "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*$gdb_prompt $" {
pass "set breakpoint at marker2"
}
-re ".*$prompt $" { fail "set breakpoint at marker2" ; return 0 }
-re ".*$gdb_prompt $" { fail "set breakpoint at marker2" ; return 0 }
timeout { fail "set breakpoint at marker2 (timeout)" ; return 0 }
}
send_gdb "info break\n"
expect {
-re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n$prompt $" { pass "info break in watchpoint.exp" }
-re ".*$prompt $" { fail "info break in watchpoint.exp" ; return 0 }
-re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n$gdb_prompt $" { pass "info break in watchpoint.exp" }
-re ".*$gdb_prompt $" { fail "info break in watchpoint.exp" ; return 0 }
timeout { fail "info break in watchpoint.exp (timeout)" ; return 0 }
}
send_gdb "watch ival3\n"
expect {
-re ".*\[Ww\]atchpoint 3: ival3\r\n$prompt $" {
-re ".*\[Ww\]atchpoint 3: ival3\r\n$gdb_prompt $" {
pass "set watchpoint on ival3"
}
-re ".*$prompt $" { fail "set watchpoint on ival3" ; return 0 }
-re ".*$gdb_prompt $" { fail "set watchpoint on ival3" ; return 0 }
timeout { fail "set watchpoint on ival3 (timeout)" ; return 0 }
}
@ -94,10 +94,10 @@ proc initialize {} {
send_gdb "info watch\n"
expect {
-re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$prompt $" {
-re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$gdb_prompt $" {
pass "watchpoint found in watchpoint/breakpoint table"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "watchpoint found in watchpoint/breakpoint table" ; return 0
}
timeout {
@ -111,8 +111,8 @@ proc initialize {} {
send_gdb "disable 3\n"
expect {
-re "disable 3\[\r\n\]+$prompt $" { pass "disable watchpoint" }
-re ".*$prompt $" { fail "disable watchpoint" ; return 0 }
-re "disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint" }
-re ".*$gdb_prompt $" { fail "disable watchpoint" ; return 0 }
timeout { fail "disable watchpoint (timeout)" ; return 0 }
}
@ -124,7 +124,7 @@ proc initialize {} {
#
proc test_simple_watchpoint {} {
global prompt
global gdb_prompt
global hex
global decimal
global noresults
@ -133,10 +133,10 @@ proc test_simple_watchpoint {} {
send_gdb "disable 3\n"
expect {
-re "^disable 3\[\r\n\]+$prompt $" {
-re "^disable 3\[\r\n\]+$gdb_prompt $" {
pass "disable watchpoint in test_simple_watchpoint"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "disable watchpoint in test_simple_watchpoint"
return 0
}
@ -151,10 +151,10 @@ proc test_simple_watchpoint {} {
gdb_run_cmd
set timeout 600
expect {
-re "Breakpoint 1, marker1 .*$prompt $" {
-re "Breakpoint 1, marker1 .*$gdb_prompt $" {
pass "run to marker1 in test_simple_watchpoint"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run to marker1 in test_simple_watchpoint"
return
}
@ -168,8 +168,8 @@ proc test_simple_watchpoint {} {
send_gdb "enable 3\n"
expect {
-re "^enable 3\[\r\n\]+$prompt $" { pass "enable watchpoint" }
-re ".*$prompt $" { fail "enable watchpoint" ; return }
-re "^enable 3\[\r\n\]+$gdb_prompt $" { pass "enable watchpoint" }
-re ".*$gdb_prompt $" { fail "enable watchpoint" ; return }
timeout { fail "enable watchpoint (timeout)" ; return }
}
@ -183,10 +183,10 @@ proc test_simple_watchpoint {} {
send_gdb "cont\n"
expect {
-re "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*$prompt $" {
-re "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*$gdb_prompt $" {
pass "watchpoint hit, first time"
}
-re "Continuing.*Breakpoint.*func1.*$prompt $" {
-re "Continuing.*Breakpoint.*func1.*$gdb_prompt $" {
setup_xfail "m68*-*-*" 2597
fail "thought it hit breakpoint at func1 twice"
gdb_test "delete \$func1_breakpoint_number" ""
@ -194,7 +194,7 @@ proc test_simple_watchpoint {} {
Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count;" \
"watchpoint hit, first time"
}
-re ".*$prompt $" { fail "watchpoint hit, first time" ; return }
-re ".*$gdb_prompt $" { fail "watchpoint hit, first time" ; return }
timeout { fail "watchpoint hit, first time (timeout)" ; return }
eof { fail "watchpoint hit, first time (eof)" ; return }
}
@ -225,8 +225,8 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count
send_gdb "disable 3\n"
expect {
-re "^disable 3\[\r\n\]+$prompt $" { pass "watchpoint disabled" }
-re ".*$prompt $" { fail "watchpoint disabled" ; return }
-re "^disable 3\[\r\n\]+$gdb_prompt $" { pass "watchpoint disabled" }
-re ".*$gdb_prompt $" { fail "watchpoint disabled" ; return }
timeout { fail "watchpoint disabled (timeout)" ; return }
}
@ -241,7 +241,7 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count
# Test disabling watchpoints.
proc test_disabling_watchpoints {} {
global prompt
global gdb_prompt
global binfile
global srcfile
global decimal
@ -252,10 +252,10 @@ proc test_disabling_watchpoints {} {
send_gdb "disable 3\n"
expect {
-re "^disable 3\[\r\n\]+$prompt $" {
-re "^disable 3\[\r\n\]+$gdb_prompt $" {
pass "disable watchpoint in test_disabling_watchpoints"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "disable watchpoint in test_disabling_watchpoints"
return 0
}
@ -270,10 +270,10 @@ proc test_disabling_watchpoints {} {
gdb_run_cmd
set timeout 600
expect {
-re "Breakpoint 1, marker1 .*$prompt $" {
-re "Breakpoint 1, marker1 .*$gdb_prompt $" {
pass "run to marker1 in test_disabling_watchpoints"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "run to marker1 in test_disabling_watchpoints"
return
}
@ -287,8 +287,8 @@ proc test_disabling_watchpoints {} {
send_gdb "enable 3\n"
expect {
-re "^enable 3\[\r\n\]+$prompt $" { pass "watchpoint enabled" }
-re ".*$prompt $" { fail "watchpoint enabled" ; return }
-re "^enable 3\[\r\n\]+$gdb_prompt $" { pass "watchpoint enabled" }
-re ".*$gdb_prompt $" { fail "watchpoint enabled" ; return }
timeout { fail "watchpoint enabled (timeout)" ; return }
}
@ -304,10 +304,10 @@ proc test_disabling_watchpoints {} {
send_gdb "disable 3\n"
expect {
-re "^disable 3\[\r\n\]+$prompt $" {
-re "^disable 3\[\r\n\]+$gdb_prompt $" {
pass "disable watchpoint #2 in test_disabling_watchpoints"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
"disable watchpoint #2 in test_disabling_watchpoints"
return 0
}
@ -334,7 +334,7 @@ proc test_disabling_watchpoints {} {
# Test stepping and other mundane operations with watchpoints enabled
proc test_stepping {} {
global prompt
global gdb_prompt
if [runto marker1] then {
gdb_test "watch ival2" ".*\[Ww\]atchpoint \[0-9\]*: ival2"
@ -383,14 +383,14 @@ proc test_stepping {} {
default { fail "finish from marker1" ; return }
}
expect {
-re "marker1 \\(\\);.*$prompt $" {
-re "marker1 \\(\\);.*$gdb_prompt $" {
send_gdb "step\n"
exp_continue
}
-re "func1 \\(\\);.*$prompt $" {
-re "func1 \\(\\);.*$gdb_prompt $" {
pass "finish from marker1"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "finish from marker1"
}
default { fail "finish from marker1" ; return }
@ -411,14 +411,14 @@ proc test_stepping {} {
gdb_test "until" "ival3 = count.*" "until to ival3 assignment"
send_gdb "until\n"
expect {
-re "(for \\(count = 0|\}).*$prompt $" {
-re "(for \\(count = 0|\}).*$gdb_prompt $" {
gdb_test "until" "ival1 = count; /. Outside loop ./" \
"until out of loop"
}
-re "ival1 = count; /. Outside loop ./.*$prompt $" {
-re "ival1 = count; /. Outside loop ./.*$gdb_prompt $" {
pass "until out of loop"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "until out of loop"
}
default { fail "until out of loop" ; return }
@ -430,7 +430,7 @@ proc test_stepping {} {
# Test stepping and other mundane operations with watchpoints enabled
proc test_watchpoint_triggered_in_syscall {} {
global prompt
global gdb_prompt
global noinferiorio
global noresults
@ -468,7 +468,7 @@ proc test_watchpoint_triggered_in_syscall {} {
-re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-re ".*$prompt $" { pass "sent 123" }
-re ".*$gdb_prompt $" { pass "sent 123" }
timeout { fail "sent 123 (timeout)" }
}
@ -476,30 +476,30 @@ proc test_watchpoint_triggered_in_syscall {} {
# should have printed.
send_gdb "print buf\[0\]\n"
expect {
-re ".*= 49.*$prompt $" { set y [expr $y+1]; pass "print buf\[0\]"}
-re ".*= 0.*$prompt $" { pass "print buf\[0\]"}
-re ".*$prompt $" { fail "print buf\[0\]"}
-re ".*= 49.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[0\]"}
-re ".*= 0.*$gdb_prompt $" { pass "print buf\[0\]"}
-re ".*$gdb_prompt $" { fail "print buf\[0\]"}
default { fail "print buf\[0\]"}
}
send_gdb "print buf\[1\]\n"
expect {
-re ".*= 50.*$prompt $" { set y [expr $y+1]; pass "print buf\[1\]"}
-re ".*= 0.*$prompt $" { pass "print buf\[1\]"}
-re ".*$prompt $" { fail "print buf\[1\]"}
-re ".*= 50.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[1\]"}
-re ".*= 0.*$gdb_prompt $" { pass "print buf\[1\]"}
-re ".*$gdb_prompt $" { fail "print buf\[1\]"}
default { fail "print buf\[1\]"}
}
send_gdb "print buf\[2\]\n"
expect {
-re ".*= 51.*$prompt $" { set y [expr $y+1]; pass "print buf\[2\]"}
-re ".*= 0.*$prompt $" { pass "print buf\[2\]"}
-re ".*$prompt $" { fail "print buf\[2\]"}
-re ".*= 51.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[2\]"}
-re ".*= 0.*$gdb_prompt $" { pass "print buf\[2\]"}
-re ".*$gdb_prompt $" { fail "print buf\[2\]"}
default { fail "print buf\[2\]"}
}
send_gdb "print buf\[3\]\n"
expect {
-re ".*= 10.*$prompt $" { set y [expr $y+1]; pass "print buf\[3\]"}
-re ".*= 0.*$prompt $" { pass "print buf\[3\]"}
-re ".*$prompt $" { fail "print buf\[3\]" }
-re ".*= 10.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[3\]"}
-re ".*= 0.*$gdb_prompt $" { pass "print buf\[3\]"}
-re ".*$gdb_prompt $" { fail "print buf\[3\]" }
default { fail "print buf\[3\]" }
}
@ -525,7 +525,7 @@ proc test_watchpoint_triggered_in_syscall {} {
# itself changes. Should add some more complicated stuff here.
proc test_complex_watchpoint {} {
global prompt
global gdb_prompt
global noresults
if [runto marker4] then {

View File

@ -37,26 +37,26 @@ if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != ""
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break xx_\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -65,7 +65,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -90,7 +90,7 @@ proc set_lang_chill {} {
# Third one is an optional message to be printed
proc test_print_accept { args } {
global prompt
global gdb_prompt
global passcount
global verbose

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
@ -49,7 +49,7 @@ proc do_tests {} {
send_gdb "set language chill\n" ;
gdb_test "break callch.ch:48 ""
send_gdb "run\n"; expect -re "Breakpoint .*callch.ch:48.*$prompt $"
send_gdb "run\n"; expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $"
gdb_test {set fred(10, i)} {a is '10'; b is '12'.}
gdb_test_exact "call klaus()" {here's klaus calling.}
gdb_test_exact "call fred()" {too few arguments in function call}

View File

@ -30,21 +30,21 @@ set bug_id 0
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
return 1
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -56,7 +56,7 @@ proc set_lang_chill {} {
}
proc test_integer_literals_accepted {} {
global prompt
global gdb_prompt
# Test various decimal values.
@ -115,7 +115,7 @@ proc test_integer_literals_accepted {} {
}
proc test_character_literals_accepted {} {
global prompt
global gdb_prompt
# Test various decimal values.
@ -132,7 +132,7 @@ proc test_character_literals_accepted {} {
}
proc test_integer_literals_rejected {} {
global prompt
global gdb_prompt
# These are valid integer literals in Z.200, but not GNU-Chill.
@ -177,7 +177,7 @@ proc test_integer_literals_rejected {} {
}
proc test_boolean_literals_accepted {} {
global prompt
global gdb_prompt
# Test the only possible values for a boolean, TRUE and FALSE.
@ -186,7 +186,7 @@ proc test_boolean_literals_accepted {} {
}
proc test_float_literals_accepted {} {
global prompt
global gdb_prompt
# Test various floating point formats
@ -246,7 +246,7 @@ proc test_float_literals_accepted {} {
}
proc test_convenience_variables {} {
global prompt
global gdb_prompt
gdb_test "set \$foo := 101" " := 101\[\r\]*" \
"Set a new convenience variable"
@ -277,7 +277,7 @@ proc test_convenience_variables {} {
}
proc test_value_history {} {
global prompt
global gdb_prompt
gdb_test "print 101" "\\\$1 = 101" \
"Set value-history\[1\] using \$1"
@ -325,7 +325,7 @@ proc test_value_history {} {
}
proc test_arithmetic_expressions {} {
global prompt
global gdb_prompt
# Test unary minus with various operands

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -38,7 +38,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -46,7 +46,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
@ -69,7 +69,7 @@ if ![set_lang_chill] then {
runto hugo_
send_gdb "set var \$i := d\n"
expect -re ".*$prompt $"
expect -re ".*$gdb_prompt $"
gdb_test "print \$i" { = d}
gdb_test "print size (\$i)" { = 1}
gdb_test "print b+c" { = 3}

View File

@ -42,7 +42,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -39,7 +39,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -47,7 +47,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}

View File

@ -38,7 +38,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -46,7 +46,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}

View File

@ -38,7 +38,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -46,7 +46,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}

View File

@ -41,26 +41,26 @@ if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != ""
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break xx_\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -69,7 +69,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -94,7 +94,7 @@ proc set_lang_chill {} {
# Third one is an optional message to be printed
proc test_print_accept { args } {
global prompt
global gdb_prompt
global passcount
global verbose
@ -112,7 +112,7 @@ proc test_print_accept { args } {
proc test_chars {} {
global passcount prompt
global passcount gdb_prompt
verbose "Testing Chars"
set passcount 0
@ -125,11 +125,11 @@ proc test_chars {} {
gdb_test "set var a := (100)'\^(0,255)' ""
test_print_accept "print a" {"\^\(0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255\)"}
send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; expect -re "$prompt $"
send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; expect -re "$prompt $"
send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"}
send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; expect -re "$prompt $"
send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; expect -re "$gdb_prompt $"
test_print_accept "print c" {'b'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
gdb_test "set var d := '\^(199)' ""
test_print_accept "print d" {'\^\(199\)'}
@ -137,21 +137,21 @@ proc test_chars {} {
test_print_accept "print (10)'\^(0)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\"" {"\^\(0,0,0,0,0,0,0,0,0,0\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
send_gdb "set var a := \"\" \n" ; expect -re "$prompt $"
send_gdb "set var a := \"\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {""}
send_gdb "set var a := \"\"\"\" \n" ; expect -re "$prompt $"
send_gdb "set var a := \"\"\"\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {""""}
send_gdb "set var a := \" \"\"\" \n" ; expect -re "$prompt $"
send_gdb "set var a := \" \"\"\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {" """}
send_gdb "set var a := \"\^\^\" \n" ; expect -re "$prompt $"
send_gdb "set var a := \"\^\^\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {"\^\^"}
send_gdb "set var a := \"'\" \n" ; expect -re "$prompt $"
send_gdb "set var a := \"'\" \n" ; expect -re "$gdb_prompt $"
test_print_accept "print a" {"'"}
}
proc test_code {} {
global passcount prompt
global passcount gdb_prompt
verbose "Testing Chars"
set passcount 0

View File

@ -41,26 +41,26 @@ if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != ""
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break xx_\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -69,7 +69,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -94,7 +94,7 @@ proc set_lang_chill {} {
# Third one is an optional message to be printed
proc test_print_accept { args } {
global prompt
global gdb_prompt
global passcount
global verbose
@ -111,7 +111,7 @@ proc test_print_accept { args } {
}
proc test_power {} {
global passcount prompt
global passcount gdb_prompt
verbose "Testing some POWERSET Stuff"
set passcount 0
@ -171,7 +171,7 @@ proc test_power {} {
gdb_test "set v_power3 := \[b5:b7, b1\] ""
test_print_accept "print v_power3" {\[b1, b5:b7\]}
send_gdb "set v_power4 := \[\"b\"\] \n" ; expect -re "$prompt $"
send_gdb "set v_power4 := \[\"b\"\] \n" ; expect -re "$gdb_prompt $"
test_print_accept "print v_power4" {\['b':'x'\]}
gdb_test "set v_power4 := \[5\] ""
test_print_accept "print v_power4" {\['b':'x'\]}

View File

@ -39,7 +39,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -47,7 +47,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
@ -94,7 +94,7 @@ if ![set_lang_chill] then {
gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]}
send_gdb "set var \$i := foo\n"
expect -re ".*$prompt $"
expect -re ".*$gdb_prompt $"
setup_xfail "m68*-*-hpux*"
gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'0\]}
}

View File

@ -37,26 +37,26 @@ if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != ""
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break xx_\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -65,7 +65,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -90,7 +90,7 @@ proc set_lang_chill {} {
# Third one is an optional message to be printed
proc test_print_accept { args } {
global prompt
global gdb_prompt
global passcount
global verbose

View File

@ -42,7 +42,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
@ -61,7 +61,7 @@ proc do_tests {} {
}
proc test_pr_5020 {} {
global prompt
global gdb_prompt
runto dummy_pr_5020
gdb_test_exact "print y" \
{= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
@ -60,7 +60,7 @@ proc do_tests {} {
}
proc test_pr_5022 {} {
global prompt
global gdb_prompt
runto dummy_pr_5022
gdb_test "p p" " = NULL" "print NULL pointer"
gdb_test "continue ""

View File

@ -42,7 +42,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
@ -50,7 +50,7 @@ proc do_tests {} {
gdb_test "break pr-5984.ch:6 ""
send_gdb "run\n"; expect -re "Breakpoint .*pr-5984.ch:6"
expect -re "$prompt $"
expect -re "$gdb_prompt $"
gdb_test "next" "Jason Dark.*" "next over Jason Dark"
}

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
@ -49,7 +49,7 @@ proc do_tests {} {
send_gdb "set language chill\n" ;
gdb_test "break pr-6292.ch:15 ""
send_gdb "run\n"; expect -re "Breakpoint .*pr-6292.ch:15.*$prompt $"
send_gdb "run\n"; expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $"
gdb_test_exact "call klaus()" {here's klaus calling.}
gdb_test {set fred(10, i)} {a was '10'; b was '12'.}
gdb_test "print i" { = 13} "print i after call"

View File

@ -43,7 +43,7 @@ if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -43,7 +43,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -42,7 +42,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -24,7 +24,7 @@ if $tracelevel then {
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -40,7 +40,7 @@ if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -24,7 +24,7 @@ if $tracelevel then {
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -39,7 +39,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
@ -47,7 +47,7 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -32,7 +32,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -37,26 +37,26 @@ if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != ""
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break dummyfunc\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -65,7 +65,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -90,7 +90,7 @@ proc set_lang_chill {} {
# Third one is an optional message to be printed
proc test_print_accept { args } {
global prompt
global gdb_prompt
global passcount
global verbose

View File

@ -45,7 +45,7 @@ if [istarget "i*86-*-sysv4*"] then {
}
proc set_lang_chill {} {
global prompt
global gdb_prompt
global binfile objdir subdir
if ![file exists $objdir/$subdir/$binfile] then {
@ -56,19 +56,19 @@ proc set_lang_chill {} {
send_gdb "set language chill\n"
expect {
-re ".*$prompt $" {}
-re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
send_gdb "show language\n"
expect {
-re ".* source language is \"chill\".*$prompt $" {
-re ".* source language is \"chill\".*$gdb_prompt $" {
pass "set language to \"chill\""
send_gdb "break dummyfunc\n"
expect {
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
send_gdb "run\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
return 1
}
timeout {
@ -77,7 +77,7 @@ proc set_lang_chill {} {
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
@ -90,7 +90,7 @@ proc set_lang_chill {} {
# checks if structure was accessed correctly
proc test_write { args } {
global prompt
global gdb_prompt
if [llength $args]==5 then {
set message [lindex $args 4]
@ -117,7 +117,7 @@ proc test_write { args } {
verbose "setting var $value..."
send_gdb "set var $location.m$extended := $value\n"
expect -re ".*$prompt $" {}
expect -re ".*$gdb_prompt $" {}
gdb_test "print $location" \
".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\
"$message"

View File

@ -34,7 +34,7 @@ if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" }
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile prompt
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0

View File

@ -30,7 +30,7 @@ set bug_id 0
# fails, then we skip the other tests.
proc set_lang_fortran {} {
global prompt
global gdb_prompt
if [gdb_test "set language fortran" ""] {
return 0;
@ -44,7 +44,7 @@ proc set_lang_fortran {} {
}
proc test_integer_literal_types_accepted {} {
global prompt
global gdb_prompt
# Test various decimal values.
@ -52,7 +52,7 @@ proc test_integer_literal_types_accepted {} {
}
proc test_character_literal_types_accepted {} {
global prompt
global gdb_prompt
# Test various character values.
@ -60,13 +60,13 @@ proc test_character_literal_types_accepted {} {
}
proc test_integer_literal_types_rejected {} {
global prompt
global gdb_prompt
test_print_reject "pt _"
}
proc test_logical_literal_types_accepted {} {
global prompt
global gdb_prompt
# Test the only possible values for a logical, TRUE and FALSE.
@ -75,7 +75,7 @@ proc test_logical_literal_types_accepted {} {
}
proc test_float_literal_types_accepted {} {
global prompt
global gdb_prompt
# Test various floating point formats

View File

@ -20,7 +20,7 @@ set bug_id 0
proc do_tests {} {
global binfile
global prompt
global gdb_prompt
# Mips/alpha targets that use gcc with mips-tfile put out the stabs
# assembler directives embedded in comments. If the assembler
@ -29,10 +29,10 @@ proc do_tests {} {
# Skip the rest of the stabs tests for this case.
send_gdb "ptype inttype\n"
expect {
-re "^ptype inttype\r*\ntype = inttype.*$prompt $" {
-re "^ptype inttype\r*\ntype = inttype.*$gdb_prompt $" {
pass "stabs found"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
setup_xfail "mips-*-*"
setup_xfail "alpha-*-*"
fail "stabs not found"
@ -193,16 +193,16 @@ field3 = 0x77888877\}" "print struct constant"
}
proc print_weird_var { var } {
global prompt
global gdb_prompt
# Make sure that the variable gets printed out correctly, without
# any sort of warning message.
send_gdb "print $var\n"
expect {
-re "^print $var\r*\n.\[0-9\]* = 42.*$prompt $" {
-re "^print $var\r*\n.\[0-9\]* = 42.*$gdb_prompt $" {
pass "variable $var printed properly"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "variable $var not printed properly"
}
timeout { fail "variable $var not printed (timeout)" }
@ -283,14 +283,14 @@ send_gdb "file $binfile\n"
# that a filename won't contain a space and a warning message will.
# But spaces following by backspaces aren't really spaces.
expect {
-re "^file (\[^ \]| +\008)*\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" {
-re "^file (\[^ \]| +\008)*\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$gdb_prompt $" {
pass "weirdx.o read without error"
}
-re "A program is being debugged already. Kill it\? \(y or n\)" {
send_gdb "y\n"
exp_continue
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "Errors reading weirdx.o"
}
timeout {

View File

@ -55,9 +55,9 @@ verbose "using GDBFLAGS = $GDBFLAGS" 2
# The variable prompt is a regexp which matches the gdb prompt. Set it if it
# is not already set.
global prompt
global gdb_prompt
if ![info exists prompt] then {
set prompt "\[(\]gdb\[)\]"
set gdb_prompt "\[(\]gdb\[)\]"
}
if ![info exists noargs] then {
@ -82,7 +82,7 @@ if ![info exists noresults] then {
proc default_gdb_version {} {
global GDB
global GDBFLAGS
global prompt
global gdb_prompt
set fileid [open "gdb_cmd" w];
puts $fileid "q";
close $fileid;
@ -111,7 +111,7 @@ proc gdb_version { } {
proc gdb_unload {} {
global verbose
global GDB
global prompt
global gdb_prompt
send_gdb "file\n"
expect {
-re "No exec file now.*\r" { exp_continue }
@ -125,7 +125,7 @@ proc gdb_unload {} {
send_gdb "y\n"
exp_continue
}
-re "$prompt $" {}
-re "$gdb_prompt $" {}
timeout {
perror "couldn't unload file in $GDB (timed out)."
return -1
@ -140,7 +140,7 @@ proc gdb_unload {} {
#
proc delete_breakpoints {} {
global prompt
global gdb_prompt
global gdb_spawn_id
send_gdb "delete breakpoints\n"
@ -149,14 +149,14 @@ proc delete_breakpoints {} {
send_gdb "y\n";
exp_continue
}
-i $gdb_spawn_id -re ".*$prompt $" { # This happens if there were no breakpoints
-i $gdb_spawn_id -re ".*$gdb_prompt $" { # This happens if there were no breakpoints
}
-i $gdb_spawn_id timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
}
send_gdb "info breakpoints\n"
expect {
-i $gdb_spawn_id -re "No breakpoints or watchpoints..*$prompt $" {}
-i $gdb_spawn_id -re ".*$prompt $" { perror "breakpoints not deleted" ; return }
-i $gdb_spawn_id -re "No breakpoints or watchpoints..*$gdb_prompt $" {}
-i $gdb_spawn_id -re ".*$gdb_prompt $" { perror "breakpoints not deleted" ; return }
-i $gdb_spawn_id -re "Delete all breakpoints.*or n.*$" {
send_gdb "y\n";
exp_continue
@ -174,7 +174,7 @@ proc delete_breakpoints {} {
# elsewhere.
#
proc gdb_run_cmd {args} {
global prompt
global gdb_prompt
global gdb_spawn_id
set spawn_id $gdb_spawn_id
@ -185,12 +185,12 @@ proc gdb_run_cmd {args} {
-re "Line.* Jump anyway.*y or n. $" {
send_gdb "y\n"
expect {
-re "Continuing.*$prompt $" {}
-re "Continuing.*$gdb_prompt $" {}
timeout { perror "Jump to start() failed (timeout)"; return }
}
}
-re "No symbol.*context.*$prompt $" {}
-re "The program is not being run.*$prompt $" {
-re "No symbol.*context.*$gdb_prompt $" {}
-re "The program is not being run.*$gdb_prompt $" {
gdb_load "";
}
timeout { perror "Jump to start() failed (timeout)"; return }
@ -210,7 +210,7 @@ proc gdb_run_cmd {args} {
}
proc gdb_breakpoint { function } {
global prompt
global gdb_prompt
global decimal
global gdb_spawn_id
@ -219,10 +219,10 @@ proc gdb_breakpoint { function } {
send_gdb "break $function\n"
# The first two regexps are what we get with -g, the third is without -g.
expect {
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$prompt $" {}
-re "Breakpoint \[0-9\]* at .*$prompt $" {}
-re "$prompt $" { fail "setting breakpoint at $function" ; return 0 }
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
}
return 1;
@ -235,7 +235,7 @@ proc gdb_breakpoint { function } {
# single quoted C++ function specifier.
proc runto { function } {
global prompt
global gdb_prompt
global decimal
global gdb_spawn_id
@ -252,13 +252,13 @@ proc runto { function } {
# the "at foo.c:36" output we get with -g.
# the "in func" output we get without -g.
expect {
-re "Break.* at .*:$decimal.*$prompt $" {
-re "Break.* at .*:$decimal.*$gdb_prompt $" {
return 1
}
-re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in $function.*$prompt $" {
-re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in $function.*$gdb_prompt $" {
return 1
}
-re "$prompt $" {
-re "$gdb_prompt $" {
fail "running to $function in runto"
return 0
}
@ -277,7 +277,7 @@ proc runto { function } {
# breakpoint() and just step out of the function.
#
proc runto_main {} {
global prompt
global gdb_prompt
global decimal
if ![target_info exists gdb_stub] {
@ -289,8 +289,8 @@ proc runto_main {} {
send_gdb "step\n"
# if use stubs step out of the breakpoint() function.
expect {
-re "main.* at .*$prompt $" {}
-re "_start.*$prompt $" {}
-re "main.* at .*$gdb_prompt $" {}
-re "_start.*$gdb_prompt $" {}
timeout { fail "single step at breakpoint() (timeout)" ; return 0 }
}
return 1
@ -314,7 +314,7 @@ proc runto_main {} {
#
proc gdb_test { args } {
global verbose
global prompt
global gdb_prompt
global GDB
global expect_out
upvar timeout timeout
@ -346,7 +346,7 @@ proc gdb_test { args } {
}
expect {
-re ".*Ending remote debugging.*$prompt$" {
-re ".*Ending remote debugging.*$gdb_prompt$" {
if ![isnative] then {
warning "Can`t communicate to remote target."
}
@ -354,7 +354,7 @@ proc gdb_test { args } {
gdb_start
set result -1
}
-re "\[\r\n\]*$pattern\[\r\n\]+$prompt $" {
-re "\[\r\n\]*$pattern\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
}
@ -364,15 +364,15 @@ proc gdb_test { args } {
send_gdb "$response_string\n";
exp_continue;
}
-re "Undefined command:.*$prompt" {
-re "Undefined command:.*$gdb_prompt" {
perror "Undefined command \"$command\"."
set result 1
}
-re "Ambiguous command.*$prompt $" {
-re "Ambiguous command.*$gdb_prompt $" {
perror "\"$command\" is not a unique command name."
set result 1
}
-re ".*Program exited with code \[0-9\]+.*$prompt $" {
-re ".*Program exited with code \[0-9\]+.*$gdb_prompt $" {
if ![string match "" $message] then {
set errmsg "$message: the program exited"
} else {
@ -381,7 +381,7 @@ proc gdb_test { args } {
fail "$errmsg"
return -1
}
-re "The program is not being run.*$prompt $" {
-re "The program is not being run.*$gdb_prompt $" {
if ![string match "" $message] then {
set errmsg "$message: the program is no longer running"
} else {
@ -390,7 +390,7 @@ proc gdb_test { args } {
fail "$errmsg"
return -1
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
if ![string match "" $message] then {
fail "$message"
}
@ -428,7 +428,7 @@ proc gdb_test { args } {
# as well.
proc test_print_reject { args } {
global prompt
global gdb_prompt
global verbose
if [llength $args]==2 then {
@ -443,39 +443,39 @@ proc test_print_reject { args } {
}
send_gdb "$sendthis\n"
expect {
-re ".*A .* in expression.*\\.*$prompt $" {
-re ".*A .* in expression.*\\.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*Invalid syntax in expression.*$prompt $" {
-re ".*Invalid syntax in expression.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*Junk after end of expression.*$prompt $" {
-re ".*Junk after end of expression.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*Invalid number.*$prompt $" {
-re ".*Invalid number.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*Invalid character constant.*$prompt $" {
-re ".*Invalid character constant.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*No symbol table is loaded.*$prompt $" {
-re ".*No symbol table is loaded.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*No symbol .* in current context.*$prompt $" {
-re ".*No symbol .* in current context.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*$expectthis.*$prompt $" {
-re ".*$expectthis.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
fail "reject $sendthis"
return 1
}
@ -504,7 +504,7 @@ proc gdb_test_exact { args } {
set command [lindex $args 0]
# This applies a special meaning to a null string pattern. Without
# this, "$pattern\r\n$prompt $" will match anything, including error
# this, "$pattern\r\n$gdb_prompt $" will match anything, including error
# messages from commands that should have no output except a new
# prompt. With this, only results of a null string will match a null
# string pattern.
@ -533,7 +533,7 @@ proc gdb_test_exact { args } {
}
proc gdb_reinitialize_dir { subdir } {
global prompt
global gdb_prompt
global gdb_spawn_id
set spawn_id $gdb_spawn_id
@ -545,23 +545,23 @@ proc gdb_reinitialize_dir { subdir } {
-re "Reinitialize source path to empty.*y or n. " {
send_gdb "y\n"
expect {
-re "Source directories searched.*$prompt $" {
-re "Source directories searched.*$gdb_prompt $" {
send_gdb "dir $subdir\n"
expect {
-re "Source directories searched.*$prompt $" {
-re "Source directories searched.*$gdb_prompt $" {
verbose "Dir set to $subdir"
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
perror "Dir \"$subdir\" failed."
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
perror "Dir \"$subdir\" failed."
}
}
}
-re ".*$prompt $" {
-re ".*$gdb_prompt $" {
perror "Dir \"$subdir\" failed."
}
}
@ -618,7 +618,7 @@ proc gdb_file_cmd { arg } {
global loadpath
global loadfile
global GDB
global prompt
global gdb_prompt
upvar timeout timeout
global gdb_spawn_id
set spawn_id $gdb_spawn_id
@ -633,11 +633,11 @@ proc gdb_file_cmd { arg } {
send_gdb "file $arg\n"
expect {
-re "Reading symbols from.*done.*$prompt $" {
-re "Reading symbols from.*done.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into the $GDB"
return 0
}
-re "has no symbol-table.*$prompt $" {
-re "has no symbol-table.*$gdb_prompt $" {
perror "$arg wasn't compiled with \"-g\""
return -1
}
@ -649,7 +649,7 @@ proc gdb_file_cmd { arg } {
-re "Load new symbol table from \".*\".*y or n. $" {
send_gdb "y\n"
expect {
-re "Reading symbols from.*done.*$prompt $" {
-re "Reading symbols from.*done.*$gdb_prompt $" {
verbose "\t\tLoaded $arg with new symbol table into $GDB"
return 0
}
@ -659,11 +659,11 @@ proc gdb_file_cmd { arg } {
}
}
}
-re ".*No such file or directory.*$prompt $" {
-re ".*No such file or directory.*$gdb_prompt $" {
perror "($arg) No such file or directory\n"
return -1
}
-re "$prompt $" {
-re "$gdb_prompt $" {
perror "couldn't load $arg into $GDB."
return -1
}
@ -692,7 +692,7 @@ proc default_gdb_start { } {
global verbose
global GDB
global GDBFLAGS
global prompt
global gdb_prompt
global timeout
global gdb_spawn_id
global spawn_id
@ -717,10 +717,10 @@ proc default_gdb_start { } {
verbose $shell_id
set timeout 10
expect {
-i $shell_id -re ".*\[\r\n\]$prompt $" {
-i $shell_id -re ".*\[\r\n\]$gdb_prompt $" {
verbose "GDB initialized."
}
-i $shell_id -re "$prompt $" {
-i $shell_id -re "$gdb_prompt $" {
perror "GDB never initialized."
set timeout $oldtimeout
verbose "Timeout restored to $timeout seconds" 2
@ -740,7 +740,7 @@ proc default_gdb_start { } {
# force the height to "unlimited", so no pagers get used
send_gdb "set height 0\n"
expect {
-i $shell_id -re ".*$prompt $" {
-i $shell_id -re ".*$gdb_prompt $" {
verbose "Setting height to 0." 2
}
-i $shell_id timeout {
@ -750,7 +750,7 @@ proc default_gdb_start { } {
# force the width to "unlimited", so no wraparound occurs
send_gdb "set width 0\n"
expect {
-i $shell_id -re ".*$prompt $" {
-i $shell_id -re ".*$gdb_prompt $" {
verbose "Setting width to 0." 2
}
-i $shell_id timeout {