* 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.
+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
# Set gdb to target the monitor
#
proc gdb_target_monitor { } {
- global prompt
+ global gdb_prompt
global exit_status
global timeout
global loadpath
global loadfile
global GDB
- global prompt
+ global gdb_prompt
global timeout
if { $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."
}
global verbose
global loadpath
global loadfile
- global prompt
+ global gdb_prompt
global GDB
set loadfile [file tail $arg]
set loadpath [file dirname $arg]
global GDB
global GDBFLAGS
global spawn_id
- global prompt
+ global gdb_prompt
global verbose
send_user "Not implememted yet\n" ; return -1
}
load_lib remote.exp
load_lib gdb.exp
-set prompt "\\(gdb\\)"
+set gdb_prompt "\\(gdb\\)"
#
# gdb_load -- load a file into the GDB.
global verbose
global loadpath
global loadfile
- global prompt
+ global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
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 }
}
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"
}
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."
}
sleep 2;
send_gdb "\ 3";
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";
}
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 {
load_lib remote.exp
load_lib gdb.exp
-set prompt "\\(gdbslet\\)"
+set gdb_prompt "\\(gdbslet\\)"
#
#
proc gdb_run_cmd {} {
- global prompt
+ global gdb_prompt
global gdb_spawn_id
set timeout 60
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"
}
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 {
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 {
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 {
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 {
global verbose
global loadpath
global loadfile
- global prompt
+ global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
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
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"
}
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 {
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
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 {
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."
}
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"
}
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 {
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 {
load_lib remote.exp
load_lib gdb.exp
-set prompt "\\(gdbslet\\)"
+set gdb_prompt "\\(gdbslet\\)"
#
proc gdb_start { } {
global gdb_spawn_id;
- global prompt
+ global gdb_prompt
global GDB
if { [default_gdb_start] != 0 } {
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;
proc gdb_sparclet_startup { } {
global gdb_spawn_id;
- global prompt
+ global gdb_prompt
global GDB
set timeout 5;
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";
}
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;
}
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
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;
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."
}
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 {
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 {
global verbose
global loadpath
global loadfile
- global prompt
+ global gdb_prompt
global GDB
global expect_out
global gdb_spawn_id
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
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 {
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."
}
}
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;
# Set gdb to the desired UDI target
#
proc gdb_target_udi { } {
- global prompt
+ global gdb_prompt
global verbose
global exit_status
-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:" {
global loadpath
global loadfile
global GDB
- global prompt
+ global gdb_prompt
if [gdb_file_cmd $arg] {
return -1
load_lib vxworks.exp
set shell_prompt "->"
-set prompt "\\(vxgdb\\)"
+set gdb_prompt "\\(vxgdb\\)"
#
# gdb_version -- extract and print the version number of gcc
# gdb_start -- start gdb running
#
proc gdb_start { } {
- global prompt
+ global gdb_prompt
global verbose
global connectmode
global reboot
}
proc spawn_vxgdb { } {
- global prompt
+ global gdb_prompt
global verbose
default_gdb_start
# 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
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.*$" {
# 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/..
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
}
}
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 {
}
proc test_with_self { executable } {
- global prompt
+ global gdb_prompt
global tool
global det_file
global decimal
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
# 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" }
}
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 {
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" }
}
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" }
}
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 {
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 {
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
}
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
}
}
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" }
}
}
}
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" }
}
}
} else {
send_gdb "set args\n"
}
-expect -re "$prompt $"
+expect -re "$gdb_prompt $"
gdb_run_cmd
}
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 {
} else {
send_gdb "set args 6\n"
}
-expect -re "$prompt $"
+expect -re "$gdb_prompt $"
gdb_run_cmd
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 {
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 {
# Reset the default arguments for VxWorks
if [istarget "*-*-vxworks*"] then {
send_gdb "set args main\n"
- expect -re ".*$prompt $" {}
+ expect -re ".*$gdb_prompt $" {}
}
-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)" }
}
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 {
#
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)" }
}
#
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)" }
}
#
proc test_next_with_recursion {} {
- global prompt
+ global gdb_prompt
global decimal
global noresults
global binfile
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 }
}
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 }
}
send_gdb "next\n"
expect {
- -re ".* factorial .value - 1.;.*$prompt $" {}
+ -re ".* factorial .value - 1.;.*$gdb_prompt $" {}
timeout { fail "next to recursive call (timeout)" ; return }
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
send_gdb "set args main\n"
- expect -re ".*$prompt $" {}
+ expect -re ".*$gdb_prompt $" {}
}
# 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
}
proc bfddefault {} {
global GDB
global GDBFLAGS
- global prompt
+ global gdb_prompt
global objdir
global subdir
global binfile
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
}
proc bfdexplicit {} {
global GDB
global GDBFLAGS
- global prompt
+ global gdb_prompt
global subdir
global objdir
global det_file
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
}
}
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 }
}
# Note that plain chars can be either signed or unsigned.
proc test_ptype_plain_types {} {
- global prompt
+ global gdb_prompt
global binfile
global bfdformat
# 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
}
proc test_ptype_unsigned_types {} {
- global prompt
+ global gdb_prompt
global binfile
global bfdformat
global det_file
# 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
}
proc test_ptype_pointer_types {} {
- global prompt
+ global gdb_prompt
global binfile
global bfdformat
global det_file
global verbose
global GDB
global GDBFLAGS
- global prompt
+ global gdb_prompt
global subdir
global objdir
global binfile
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" }
}
-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" }
}
}
-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" }
}
#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.*$" {
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" }
}
#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" }
}
#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" }
}
}
#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" }
}
}
# 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" }
}
#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
#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" }
}
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" }
}
}
-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" }
}
}
-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"
}
#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"
#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"
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
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)" }
}
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)" }
}
#
proc set_listsize { arg } {
- global prompt
+ global gdb_prompt
if [gdb_test "set listsize $arg" "" "setting listsize to $arg"] {
return 0;
#
proc test_listsize {} {
- global prompt
+ global gdb_prompt
# Show default size
#
proc test_list_include_file {} {
- global prompt
+ global gdb_prompt
# FIXME Fails for COFF as well, I think.
setup_xfail "a29k-*-udi"
#
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)"
#
proc test_list_function {} {
- global prompt
+ global gdb_prompt
global gcc_compiled
# gcc appears to generate incorrect debugging information for code
}
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 }
}
}
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 }
}
#
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"
#
proc test_list_filename_and_function {} {
- global prompt
+ global gdb_prompt
set testcnt 0
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)" }
}
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*"
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)" }
}
# 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)" }
}
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*"
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 }
}
}
# 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
}
proc test_integer_literals_accepted {} {
- global prompt
+ global gdb_prompt
# Test various decimal values.
}
proc test_character_literals_accepted {} {
- global prompt
+ global gdb_prompt
gdb_test "p 'a'" " = 97 'a'"
gdb_test "p/c 'a'" " = 97 'a'"
}
proc test_integer_literals_rejected {} {
- global prompt
+ global gdb_prompt
test_print_reject "p 0x"
gdb_test "p ''" "Empty character constant\\."
}
proc test_print_all_chars {} {
- global prompt
+ global gdb_prompt
gdb_test "p ctable1\[0\]" " = 0 '\\\\000'"
gdb_test "p ctable1\[1\]" " = 1 '\\\\001'"
# 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\"..."
}
proc test_print_strings {} {
- global prompt
+ global gdb_prompt
# We accept "(unsigned char *) " before the string. char vs. unsigned char
# is already tested elsewhere.
}
proc test_print_int_arrays {} {
- global prompt
+ global gdb_prompt
gdb_test "set print elements 24" ""
}
proc test_print_char_arrays {} {
- global prompt
+ global gdb_prompt
global hex
gdb_test "set print elements 24" ""
}
proc test_print_string_constants {} {
- global prompt
+ global gdb_prompt
gdb_test "set print elements 50" ""
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" }
}
(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" }
}
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.
(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" }
}
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.
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" }
}
#
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" }
}
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" }
}
#
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" }
}
#
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" }
}
#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" }
#}
#
#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" }
#}
#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" }
#}
#
#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" }
#}
#
#
#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" }
#}
#
#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" }
#}
#
#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" }
#}
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" }
}
-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" }
}
-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" }
}
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" }
}
-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" }
}
-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" }
}
#
# 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"
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]";
proc test_one_sig {nextsig} {
global sig_supported
- global prompt
+ global gdb_prompt
global thissig
set this_sig_supported $sig_supported
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
}
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
}
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)" }
}
}
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'}"
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
# 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 }
}
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 {
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 }
}
#
proc test_simple_watchpoint {} {
- global prompt
+ global gdb_prompt
global hex
global decimal
global noresults
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
}
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
}
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 }
}
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" ""
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 }
}
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 }
}
# Test disabling watchpoints.
proc test_disabling_watchpoints {} {
- global prompt
+ global gdb_prompt
global binfile
global srcfile
global decimal
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
}
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
}
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 }
}
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
}
# 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"
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 }
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 }
# Test stepping and other mundane operations with watchpoints enabled
proc test_watchpoint_triggered_in_syscall {} {
- global prompt
+ global gdb_prompt
global noinferiorio
global noresults
-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)" }
}
# 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\]" }
}
# itself changes. Should add some more complicated stuff here.
proc test_complex_watchpoint {} {
- global prompt
+ global gdb_prompt
global noresults
if [runto marker4] then {
# 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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# Third one is an optional message to be printed
proc test_print_accept { args } {
- global prompt
+ global gdb_prompt
global passcount
global verbose
}
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
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}
# 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
}
}
proc test_integer_literals_accepted {} {
- global prompt
+ global gdb_prompt
# Test various decimal values.
}
proc test_character_literals_accepted {} {
- global prompt
+ global gdb_prompt
# Test various decimal values.
}
proc test_integer_literals_rejected {} {
- global prompt
+ global gdb_prompt
# These are valid integer literals in Z.200, but not GNU-Chill.
}
proc test_boolean_literals_accepted {} {
- global prompt
+ global gdb_prompt
# Test the only possible values for a boolean, TRUE and FALSE.
}
proc test_float_literals_accepted {} {
- global prompt
+ global gdb_prompt
# Test various floating point formats
}
proc test_convenience_variables {} {
- global prompt
+ global gdb_prompt
gdb_test "set \$foo := 101" " := 101\[\r\]*" \
"Set a new convenience variable"
}
proc test_value_history {} {
- global prompt
+ global gdb_prompt
gdb_test "print 101" "\\\$1 = 101" \
"Set value-history\[1\] using \$1"
}
proc test_arithmetic_expressions {} {
- global prompt
+ global gdb_prompt
# Test unary minus with various operands
}
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
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
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}
}
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
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
# 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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# Third one is an optional message to be printed
proc test_print_accept { args } {
- global prompt
+ global gdb_prompt
global passcount
global verbose
proc test_chars {} {
- global passcount prompt
+ global passcount gdb_prompt
verbose "Testing Chars"
set passcount 0
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\)'}
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
# 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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# Third one is an optional message to be printed
proc test_print_accept { args } {
- global prompt
+ global gdb_prompt
global passcount
global verbose
}
proc test_power {} {
- global passcount prompt
+ global passcount gdb_prompt
verbose "Testing some POWERSET Stuff"
set passcount 0
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'\]}
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
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\]}
}
# 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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# Third one is an optional message to be printed
proc test_print_accept { args } {
- global prompt
+ global gdb_prompt
global passcount
global verbose
}
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
}
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
}
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
}
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]]}
}
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
}
proc test_pr_5022 {} {
- global prompt
+ global gdb_prompt
runto dummy_pr_5022
gdb_test "p p" " = NULL" "print NULL pointer"
gdb_test "continue ""
}
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
}
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
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"
}
}
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
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"
}
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
}
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
}
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
}
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
}
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
}
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
}
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
# fails, then we skip the other tests.
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
send_gdb "set language chill\n"
expect {
- -re ".*$prompt $" {}
+ -re ".*$gdb_prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
}
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
}
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
# 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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# Third one is an optional message to be printed
proc test_print_accept { args } {
- global prompt
+ global gdb_prompt
global passcount
global verbose
}
proc set_lang_chill {} {
- global prompt
+ global gdb_prompt
global binfile objdir subdir
if ![file exists $objdir/$subdir/$binfile] then {
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 {
}
}
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
fail "setting language to \"chill\""
return 0
}
# 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]
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"
}
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
# fails, then we skip the other tests.
proc set_lang_fortran {} {
- global prompt
+ global gdb_prompt
if [gdb_test "set language fortran" ""] {
return 0;
}
proc test_integer_literal_types_accepted {} {
- global prompt
+ global gdb_prompt
# Test various decimal values.
}
proc test_character_literal_types_accepted {} {
- global prompt
+ global gdb_prompt
# Test various character values.
}
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.
}
proc test_float_literal_types_accepted {} {
- global prompt
+ global gdb_prompt
# Test various floating point formats
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
# 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"
}
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)" }
# 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 {
# 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 {
proc default_gdb_version {} {
global GDB
global GDBFLAGS
- global prompt
+ global gdb_prompt
set fileid [open "gdb_cmd" w];
puts $fileid "q";
close $fileid;
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 }
send_gdb "y\n"
exp_continue
}
- -re "$prompt $" {}
+ -re "$gdb_prompt $" {}
timeout {
perror "couldn't unload file in $GDB (timed out)."
return -1
#
proc delete_breakpoints {} {
- global prompt
+ global gdb_prompt
global gdb_spawn_id
send_gdb "delete breakpoints\n"
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
# elsewhere.
#
proc gdb_run_cmd {args} {
- global prompt
+ global gdb_prompt
global gdb_spawn_id
set spawn_id $gdb_spawn_id
-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 }
}
proc gdb_breakpoint { function } {
- global prompt
+ global gdb_prompt
global decimal
global gdb_spawn_id
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;
# single quoted C++ function specifier.
proc runto { function } {
- global prompt
+ global gdb_prompt
global decimal
global gdb_spawn_id
# 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
}
# breakpoint() and just step out of the function.
#
proc runto_main {} {
- global prompt
+ global gdb_prompt
global decimal
if ![target_info exists gdb_stub] {
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
#
proc gdb_test { args } {
global verbose
- global prompt
+ global gdb_prompt
global GDB
global expect_out
upvar timeout timeout
}
expect {
- -re ".*Ending remote debugging.*$prompt$" {
+ -re ".*Ending remote debugging.*$gdb_prompt$" {
if ![isnative] then {
warning "Can`t communicate to remote target."
}
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"
}
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 {
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 {
fail "$errmsg"
return -1
}
- -re ".*$prompt $" {
+ -re ".*$gdb_prompt $" {
if ![string match "" $message] then {
fail "$message"
}
# as well.
proc test_print_reject { args } {
- global prompt
+ global gdb_prompt
global verbose
if [llength $args]==2 then {
}
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
}
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.
}
\f
proc gdb_reinitialize_dir { subdir } {
- global prompt
+ global gdb_prompt
global gdb_spawn_id
set spawn_id $gdb_spawn_id
-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."
}
}
global loadpath
global loadfile
global GDB
- global prompt
+ global gdb_prompt
upvar timeout timeout
global gdb_spawn_id
set spawn_id $gdb_spawn_id
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
}
-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
}
}
}
}
- -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
}
global verbose
global GDB
global GDBFLAGS
- global prompt
+ global gdb_prompt
global timeout
global gdb_spawn_id
global spawn_id
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
# 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 {
# 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 {