diff options
author | Bob Manson <manson@cygnus> | 1997-02-02 07:59:25 +0000 |
---|---|---|
committer | Bob Manson <manson@cygnus> | 1997-02-02 07:59:25 +0000 |
commit | 85fbaa747f9edd4184cce516c8804bb4553e08f7 (patch) | |
tree | 3011762b44f70c7e2abfd700004d1d0652c831a9 /gdb/testsuite/gdb.base | |
parent | e385d6e03e0733be01c51d24588b981c9e928d6c (diff) | |
download | gdb-85fbaa747f9edd4184cce516c8804bb4553e08f7.zip gdb-85fbaa747f9edd4184cce516c8804bb4553e08f7.tar.gz gdb-85fbaa747f9edd4184cce516c8804bb4553e08f7.tar.bz2 |
* gdb.*/*.exp: Replace $prompt with $gdb_prompt.
* gdb.base/scope.exp: Use gdb_test.
* gdb.c++/classes.exp: Ditto.
* gdb.c++/inherit.exp: Ditto.
More random cleanups. Still lots to go, however.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/a1-selftest.exp | 94 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/a2-run.exp | 40 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 26 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/callfuncs.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/crossload.exp | 36 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/default.exp | 90 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/help.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/interrupt.exp | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list.exp | 106 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/printcmds.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ptype.exp | 238 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/setvar.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/sigall.exp | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/structs.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoint.exp | 112 |
15 files changed, 412 insertions, 412 deletions
diff --git a/gdb/testsuite/gdb.base/a1-selftest.exp b/gdb/testsuite/gdb.base/a1-selftest.exp index 37a4267..35c86fb 100644 --- a/gdb/testsuite/gdb.base/a1-selftest.exp +++ b/gdb/testsuite/gdb.base/a1-selftest.exp @@ -46,7 +46,7 @@ if [istarget "m68k*-*-hpux*"] then { # to a line that we know is always executed. proc do_steps_and_nexts {} { - global prompt + global gdb_prompt global srcdir gdb_reinitialize_dir $srcdir/.. @@ -54,87 +54,87 @@ proc do_steps_and_nexts {} { for {set count 0} {$count < 20} {incr count} { send "list\n" expect { - -re ".*symarg = NULL.*$prompt $" { + -re ".*symarg = NULL.*$gdb_prompt $" { set description "step over symarg initialization" set command "step" } - -re ".*execarg = NULL.*$prompt $" { + -re ".*execarg = NULL.*$gdb_prompt $" { set description "step over execarg initialization" set command "step" } - -re ".*corearg = NULL.*$prompt $" { + -re ".*corearg = NULL.*$gdb_prompt $" { set description "step over corearg initialization" set command "step" } - -re ".*cdarg = NULL.*$prompt $" { + -re ".*cdarg = NULL.*$gdb_prompt $" { set description "step over cdarg initialization" set command "step" } - -re ".*ttyarg = NULL.*$prompt $" { + -re ".*ttyarg = NULL.*$gdb_prompt $" { set description "step over ttyarg initialization" set command "step" } - -re ".*time_at_startup = get_run_time.*$prompt $" { + -re ".*time_at_startup = get_run_time.*$gdb_prompt $" { set description "next over get_run_time and everything it calls" set command "next" } - -re ".*START_PROGRESS.*$prompt $" { + -re ".*START_PROGRESS.*$gdb_prompt $" { set description "next over START_PROGRESS and everything it calls" set command "next" } - -re ".*mac_init.*$prompt $" { + -re ".*mac_init.*$gdb_prompt $" { set description "next over mac_init and everything it calls" set command "next" } - -re ".*init_malloc.*$prompt $" { + -re ".*init_malloc.*$gdb_prompt $" { set description "next over init_malloc and everything it calls" set command "next" } - -re ".*count . 0x3.*$prompt $" { + -re ".*count . 0x3.*$gdb_prompt $" { set description "next over conditional stack alignment code 1" set command "next" } - -re ".*if .i != 0.*$prompt $" { + -re ".*if .i != 0.*$gdb_prompt $" { set description "next over conditional stack alignment code 2" set command "next" } - -re ".*alloca .i - 4.*$prompt $" { + -re ".*alloca .i - 4.*$gdb_prompt $" { set description "next over conditional stack alignment alloca" set command "next" } - -re ".*SET_TOP_LEVEL.*$prompt $" { + -re ".*SET_TOP_LEVEL.*$gdb_prompt $" { set description "next over SET_TOP_LEVEL call" set command "next" } - -re ".*cmdsize = 1.*$prompt $" { + -re ".*cmdsize = 1.*$gdb_prompt $" { set description "step over cmdsize initialization" set command "next" } - -re ".*cmdarg = .* xmalloc.*$prompt $" { + -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" { set description "next over cmdarg initialization via xmalloc" set command "next" } - -re ".*ncmd = 0.*$prompt $" { + -re ".*ncmd = 0.*$gdb_prompt $" { set description "next over ncmd initialization" set command "next" } - -re ".*dirsize = 1.*$prompt $" { + -re ".*dirsize = 1.*$gdb_prompt $" { set description "next over dirsize initialization" set command "next" } - -re ".*dirarg = .* xmalloc.*$prompt $" { + -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { return } - -re "\[ \t\]+\{\r\n$prompt $" { + -re "\[ \t\]+\{\r\n$gdb_prompt $" { setup_xfail "mips-*-irix5*" fail "$description ended up at odd location" } - -re ".*main.c.*No such file or directory.*$prompt $" { + -re ".*main.c.*No such file or directory.*$gdb_prompt $" { setup_xfail "rs6000-*-aix3*" fail "must be able to list source lines" return } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "unknown source line after $description" return } @@ -145,13 +145,13 @@ proc do_steps_and_nexts {} { } send "$command\n" expect { - -re ".*No such file or directory.\r\n$prompt $" { + -re ".*No such file or directory.\r\n$gdb_prompt $" { fail "$description (no source available)" } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { + -re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" { fail "$description (no source available)" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { pass "$description" } timeout { @@ -162,7 +162,7 @@ proc do_steps_and_nexts {} { } proc test_with_self { executable } { - global prompt + global gdb_prompt global tool global det_file global decimal @@ -221,19 +221,19 @@ proc test_with_self { executable } { set description "run until breakpoint at main" send "run -nw\n" expect { - -re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$prompt $" { + -re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" { pass "$description" } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$prompt $" { + -re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$gdb_prompt $" { xfail "$description (line numbers scrambled?)" } - -re "vfork: No more processes.*$prompt $" { + -re "vfork: No more processes.*$gdb_prompt $" { fail "$description (out of virtual memory)" set timeout $oldtimeout verbose "Timeout is now $timeout seconds" 2 return -1 } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "$description" set timeout $oldtimeout verbose "Timeout is now $timeout seconds" 2 @@ -250,13 +250,13 @@ proc test_with_self { executable } { # do we have a version number ? send "print version\n" expect { - -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$prompt $" { + -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" { pass "printed version" } - -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$prompt $" { + -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" { pass "printed version with cast" } - -re ".*$prompt $" { fail "printed version" } + -re ".*$gdb_prompt $" { fail "printed version" } timeout { fail "(timeout) printed version" } } @@ -273,16 +273,16 @@ proc test_with_self { executable } { set description "step into xmalloc call" send "step\n" expect { - -re "xmalloc.*size=.*at.*utils.c.*$prompt $" { + -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" { pass "$description" } - -re ".*No such file or directory.\r\n$prompt $" { + -re ".*No such file or directory.\r\n$gdb_prompt $" { pass "$description (no source available)" } - -re "A file or directory .* does not exist..\r\n$prompt $" { + -re "A file or directory .* does not exist..\r\n$gdb_prompt $" { pass "$description (no source available)" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "$description" } timeout { @@ -299,14 +299,14 @@ GDB is free software, covered by the GNU General Public License, and you are.* welcome to change it and/or distribute copies of it under certain conditions.* Type \"show copying\" to see the conditions.* There is absolutely no warranty for GDB. Type \"show warranty\" for details.* -This GDB was configured as .*$prompt $"\ +This GDB was configured as .*$gdb_prompt $"\ { pass "xgdb is at prompt" } -re "GDB is free software and you are welcome to distribute copies of it.* under certain conditions; type \"show copying\" to see the conditions..* There is absolutely no warranty for GDB; type \"show warranty\" for details..* -GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ +GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ { pass "xgdb is at prompt (obsolescent gdb)" } - -re ".*$prompt $" { fail "xgdb is at prompt" } + -re ".*$gdb_prompt $" { fail "xgdb is at prompt" } timeout { fail "(timeout) xgdb is at prompt" } } @@ -314,7 +314,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ send "set prompt (xgdb) \n" expect { -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" } - -re ".*$prompt $" { fail "Set xgdb prompt" } + -re ".*$gdb_prompt $" { fail "Set xgdb prompt" } default { fail "(timeout) Set xgdb prompt" } } @@ -322,10 +322,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ set description "send ^C to child process" send "\003" expect { - -re "Program received signal SIGINT.*$prompt $" { + -re "Program received signal SIGINT.*$gdb_prompt $" { pass "$description" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "$description" } timeout { @@ -336,10 +336,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ set description "send SIGINT signal to child process" send "signal SIGINT\n" expect { - -re "Continuing with signal SIGINT.*$prompt $" { + -re "Continuing with signal SIGINT.*$gdb_prompt $" { pass "$description" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "$description" } timeout { @@ -356,10 +356,10 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ set description "backtrace through signal handler" send "backtrace\n" expect { - -re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$prompt $" { + -re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" { pass "$description" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { # On the alpha, we hit the infamous problem about gdb # being unable to get the frame pointer (mentioned in # gdb/README). As it is intermittent, there is no way to diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp index 89f2c7d..57c7a82 100644 --- a/gdb/testsuite/gdb.base/a2-run.exp +++ b/gdb/testsuite/gdb.base/a2-run.exp @@ -74,13 +74,13 @@ if [istarget "*-*-vxworks*"] then { } set timeout 10 verbose "Timeout is now $timeout seconds" 2 - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { expect { - -re ".*usage: factorial <number>.*Program exited with code 01.*$prompt $" { + -re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" { pass "run \"$testfile\" with no args" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run \"$testfile\" with no args" verbose "expect_out is $expect_out(buffer)" 2 } @@ -108,14 +108,14 @@ if [istarget "*-*-vxworks*"] then { } set timeout 10 verbose "Timeout is now $timeout seconds" 2 - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { setup_xfail "mips-idt-*" gdb_run_cmd 5 expect { - -re ".*120.*$prompt $"\ + -re ".*120.*$gdb_prompt $"\ { pass "run \"$testfile\" with arg" } - -re ".*$prompt $" { fail "run \"$testfile\" with arg" } + -re ".*$gdb_prompt $" { fail "run \"$testfile\" with arg" } timeout { fail "(timeout) run \"$testfile\" with arg" } } } @@ -136,12 +136,12 @@ if [istarget "*-*-vxworks*"] then { } set timeout 10 verbose "Timeout is now $timeout seconds" 2 - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { expect { - -re ".*120.*$prompt $"\ + -re ".*120.*$gdb_prompt $"\ { pass "run \"$testfile\" again with same args" } - -re ".*$prompt $" { fail "run \"$testfile\" again with same args" } + -re ".*$gdb_prompt $" { fail "run \"$testfile\" again with same args" } timeout { fail "(timeout) run \"$testfile\" again with same args" } } } @@ -152,7 +152,7 @@ if [istarget "*-*-vxworks*"] then { } else { send_gdb "set args\n" } -expect -re "$prompt $" +expect -re "$gdb_prompt $" gdb_run_cmd @@ -172,13 +172,13 @@ if [istarget "*-*-vxworks*"] then { } set timeout 10 verbose "Timeout is now $timeout seconds" 2 - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { expect { - -re ".*usage: factorial <number>.*$prompt $" { + -re ".*usage: factorial <number>.*$gdb_prompt $" { pass "run after setting args to nil" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run after setting args to nil" } timeout { @@ -194,7 +194,7 @@ if [istarget "*-*-vxworks*"] then { } else { send_gdb "set args 6\n" } -expect -re "$prompt $" +expect -re "$gdb_prompt $" gdb_run_cmd if [istarget "*-*-vxworks*"] then { @@ -213,13 +213,13 @@ if [istarget "*-*-vxworks*"] then { } set timeout 10 verbose "Timeout is now $timeout seconds" 2 - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { expect { - -re ".*720.*$prompt $" { + -re ".*720.*$gdb_prompt $" { pass "run \"$testfile\" again after setting args" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run \"$testfile\" again after setting args" } timeout { @@ -233,10 +233,10 @@ if [istarget "*-*-vxworks*"] then { if [isnative] then { send_gdb "run `echo 8`\n" expect { - -re "Starting program.*40320.*$prompt $" { + -re "Starting program.*40320.*$gdb_prompt $" { pass "run \"$testfile\" with shell" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run \"$testfile\" with shell" } timeout { @@ -248,5 +248,5 @@ if [isnative] then { # Reset the default arguments for VxWorks if [istarget "*-*-vxworks*"] then { send_gdb "set args main\n" - expect -re ".*$prompt $" {} + expect -re ".*$gdb_prompt $" {} } diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 2c6b11f..a027b2f 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -61,14 +61,14 @@ expect { -i $gdb_spawn_id -re "Delete all breakpoints.*$" { send_gdb "y\n" expect { - -re "$prompt $" { + -re "$gdb_prompt $" { setup_xfail "i*86-*-sysv4*" "sparc-sun-sunos4*" "alpha-dec-osf*" "mips-dec-ultrix*" fail "Delete all breakpoints when none (unexpected prompt)" } timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" } } } - -i $gdb_spawn_id -re ".*$prompt $" { pass "Delete all breakpoints when none" } + -i $gdb_spawn_id -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" } timeout { fail "Delete all breakpoints when none (timeout)" } } @@ -151,9 +151,9 @@ if ![target_info exists use_gdb_stub] { send_gdb "y\n" exp_continue } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$prompt $"\ + -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$gdb_prompt $"\ { pass "run until function breakpoint" } - -re ".*$prompt $" { fail "run until function breakpoint" } + -re ".*$gdb_prompt $" { fail "run until function breakpoint" } timeout { fail "run until function breakpoint (timeout)" } } } else { @@ -204,8 +204,8 @@ gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" # send_gdb "tbreak 64\n" expect { - -re "Breakpoint.*at.* file .*$srcfile, line 64.*$prompt $" { pass "Temporary breakpoint line number" } - -re ".*$prompt $" { pass "Temporary breakpoint line number" } + -re "Breakpoint.*at.* file .*$srcfile, line 64.*$gdb_prompt $" { pass "Temporary breakpoint line number" } + -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number" } timeout { fail "breakpoint line number (timeout)" } } @@ -216,8 +216,8 @@ gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary br # send_gdb "tbreak $srcfile:70\n" expect { - -re "Breakpoint.*at.* file .*$srcfile, line 70.*$prompt $" { pass "Temporary breakpoint line number in file" } - -re ".*$prompt $" { pass "Temporary breakpoint line number in file" } + -re "Breakpoint.*at.* file .*$srcfile, line 70.*$gdb_prompt $" { pass "Temporary breakpoint line number in file" } + -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file" } timeout { fail "Temporary breakpoint line number in file (timeout)" } } @@ -242,7 +242,7 @@ proc test_clear_command {} { # proc test_next_with_recursion {} { - global prompt + global gdb_prompt global decimal global noresults global binfile @@ -272,7 +272,7 @@ proc test_next_with_recursion {} { gdb_run_cmd } expect { - -re "Break.* factorial .value=6. .*$prompt $" {} + -re "Break.* factorial .value=6. .*$gdb_prompt $" {} timeout { fail "run to factorial(6) (timeout)" ; return } } @@ -280,7 +280,7 @@ proc test_next_with_recursion {} { send_gdb "continue\n" expect { - -re "Continuing.*Break.* factorial .value=5. .*$prompt $" {} + -re "Continuing.*Break.* factorial .value=5. .*$gdb_prompt $" {} timeout { fail "continue to factorial(5) (timeout)" ; return } } @@ -296,7 +296,7 @@ proc test_next_with_recursion {} { send_gdb "next\n" expect { - -re ".* factorial .value - 1.;.*$prompt $" {} + -re ".* factorial .value - 1.;.*$gdb_prompt $" {} timeout { fail "next to recursive call (timeout)" ; return } } @@ -341,5 +341,5 @@ if [istarget "*-*-vxworks*"] { set timeout 10 verbose "Timeout is now $timeout seconds" 2 send_gdb "set args main\n" - expect -re ".*$prompt $" {} + expect -re ".*$gdb_prompt $" {} } diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 1f0ca64..71286e4 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -60,21 +60,21 @@ if [target_info exists gdb,cannot_call_functions] { # fails, then we skip the other tests. proc set_lang_c {} { - global prompt + global gdb_prompt send_gdb "set language c\n" expect { - -re ".*$prompt $" {} + -re ".*$gdb_prompt $" {} timeout { fail "set language c (timeout)" ; return 0 } } send_gdb "show language\n" expect { - -re ".* source language is \"c\".*$prompt $" { + -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "setting language to \"c\"" return 0 } diff --git a/gdb/testsuite/gdb.base/crossload.exp b/gdb/testsuite/gdb.base/crossload.exp index 0683cf9..020e238 100644 --- a/gdb/testsuite/gdb.base/crossload.exp +++ b/gdb/testsuite/gdb.base/crossload.exp @@ -65,7 +65,7 @@ if [istarget "a29k-*-*"] then { proc bfddefault {} { global GDB global GDBFLAGS - global prompt + global gdb_prompt global objdir global subdir global binfile @@ -80,21 +80,21 @@ proc bfddefault {} { send_gdb "y\n" exp_continue } - -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$prompt $" { + -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" { pass "$binfile ($bfdformat) auto format" } - -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+.no debugging symbols found.\[.\]+done\..*$prompt $" { + -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+.no debugging symbols found.\[.\]+done\..*$gdb_prompt $" { pass "$binfile ($bfdformat) auto format (but no symbols found)" } - -re "File format not recognized.*$prompt $" { + -re "File format not recognized.*$gdb_prompt $" { fail "$binfile ($bfdformat) auto format (format not recognized)" return } - -re "File format is ambiguous.*$prompt $" { + -re "File format is ambiguous.*$gdb_prompt $" { fail "$binfile ($bfdformat) auto format (format is ambiguous)" return } - -re "$prompt $" { + -re "$gdb_prompt $" { fail "$binfile ($bfdformat) auto format" return } @@ -117,7 +117,7 @@ proc bfddefault {} { proc bfdexplicit {} { global GDB global GDBFLAGS - global prompt + global gdb_prompt global subdir global objdir global det_file @@ -141,14 +141,14 @@ proc bfdexplicit {} { send_gdb "y\n" exp_continue } - -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$prompt $" { + -re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" { pass "$binfile ($bfdformat) explicit format" } - -re "Invalid target.*$prompt $" { + -re "Invalid target.*$gdb_prompt $" { fail "$binfile ($bfdformat) explicit format (invalid target)" return } - -re "$prompt $" { + -re "$gdb_prompt $" { fail "$binfile ($bfdformat) explicit format" return } @@ -162,13 +162,13 @@ proc bfdexplicit {} { } proc test_ptype_functions {} { - global prompt + global gdb_prompt global binfile global bfdformat global det_file send_gdb "ptype main\n" expect { - -re "type = int \[)(\]+\r\n$prompt $" {} + -re "type = int \[)(\]+\r\n$gdb_prompt $" {} timeout { fail "(timeout) $binfile ($bfdformat) function main" ; return } } @@ -192,7 +192,7 @@ proc test_ptype_functions {} { # Note that plain chars can be either signed or unsigned. proc test_ptype_plain_types {} { - global prompt + global gdb_prompt global binfile global bfdformat @@ -217,7 +217,7 @@ proc test_ptype_plain_types {} { # defined away and the variables default to plain types. So accept either. proc test_ptype_signed_types {} { - global prompt + global gdb_prompt global binfile global bfdformat global det_file @@ -241,7 +241,7 @@ proc test_ptype_signed_types {} { } proc test_ptype_unsigned_types {} { - global prompt + global gdb_prompt global binfile global bfdformat global det_file @@ -266,7 +266,7 @@ proc test_ptype_unsigned_types {} { # Note that plain chars can be either signed or unsigned. proc test_ptype_array_types {} { - global prompt + global gdb_prompt global binfile global bfdformat global det_file @@ -290,7 +290,7 @@ proc test_ptype_array_types {} { } proc test_ptype_pointer_types {} { - global prompt + global gdb_prompt global binfile global bfdformat global det_file @@ -316,7 +316,7 @@ proc loadandtest { args } { global verbose global GDB global GDBFLAGS - global prompt + global gdb_prompt global subdir global objdir global binfile diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index f82849e..835c506 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -16,17 +16,17 @@ gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "a setup_xfail "mips-idt-*" send_gdb "attach\n" expect { - -re "Argument required .(process-id|program) to attach.*$prompt $"\ + -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\ { pass "attach" } - -re "You can't do that when your target is `None'.*$prompt $"\ + -re "You can't do that when your target is `None'.*$gdb_prompt $"\ { pass "attach" } - -re "Don't know how to attach. Try \"help target\"..*$prompt $"\ + -re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\ { pass "attach" } -re "Kill it. .y or n." { send_gdb "y\n" exp_continue } - -re "$prompt $" { fail "attach" } + -re "$gdb_prompt $" { fail "attach" } timeout { fail "(timeout) attach" } } @@ -103,7 +103,7 @@ expect { -re "Delete all auto-display expressions.*y or n. $" { send_gdb "y\n" expect { - -re "$prompt $" { pass "delete display prompt" } + -re "$gdb_prompt $" { pass "delete display prompt" } timeout { fail "(timeout) delete display prompt" } } } @@ -132,7 +132,7 @@ expect { -re "Reinitialize source path to empty.*y or n. $" { send_gdb "y\n" expect { - -re "Source directories searched: .cdir:.cwd.*$prompt $"\ + -re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\ { pass "directory prompt" } timeout { fail "(timeout) directory prompt" } } @@ -180,7 +180,7 @@ gdb_test "enable" "" "enable" #test exec-file send_gdb "exec-file\n" expect { - -re "No exec file now..*$prompt $" { + -re "No exec file now..*$gdb_prompt $" { pass "exec-file" } -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" { @@ -188,10 +188,10 @@ expect { if $verbose>1 then { send_user "\tDidn't kill program being debugged\n" } - expect -re "$prompt $" { } + expect -re "$gdb_prompt $" { } pass "exec-file" } - -re "$prompt $" { fail "exec-file" } + -re "$gdb_prompt $" { fail "exec-file" } timeout { fail "(timeout) exec-file" } } @@ -208,17 +208,17 @@ gdb_test "fg" "The program is not being run." "fg" #test file send_gdb "file\n" expect { - -re "No exec file now..*$prompt $"\ + -re "No exec file now..*$gdb_prompt $"\ { pass "file" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } - expect -re "$prompt $" { } + expect -re "$gdb_prompt $" { } pass "file" } - -re ".*$prompt $" { fail "file" } + -re ".*$gdb_prompt $" { fail "file" } timeout { fail "(timeout) file" } } @@ -351,31 +351,31 @@ gdb_test "pwd" "Working directory .*" "pwd" #test run "r" abbreviation if [istarget "*-*-vxworks*"] then { send_gdb "set args\n" - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} gdb_test "r" "Starting program: .* You must specify a function name to run, and arguments if any"\ "run \"r\" abbreviation" send_gdb "set args main\n" - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { send_gdb "r\n" expect { -re "Starting program: .* -You can't do that when your target is `None'.*$prompt $"\ +You can't do that when your target is `None'.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } -re "Starting program: .* No executable file specified.* -Use the \"file\" or \"exec-file\" command.*$prompt $"\ +Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } -re "Starting program: .* -No image loaded into target.*$prompt $"\ +No image loaded into target.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } -re "Starting program: .* -No program loaded.*$prompt $"\ +No program loaded.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } - -re "Don't know how to run. Try \"help target\"..*$prompt $"\ + -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } - -re ".*$prompt $" { fail "run \"r\" abbreviation" } + -re ".*$gdb_prompt $" { fail "run \"r\" abbreviation" } timeout { fail "(timeout) run \"r\" abbreviation" } } } @@ -383,28 +383,28 @@ No program loaded.*$prompt $"\ #test run if [istarget "*-*-vxworks*"] then { send_gdb "set args\n" - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} gdb_test "run" "Starting program: .* You must specify a function name to run, and arguments if any" send_gdb "set args main\n" - expect -re "$prompt $" {} + expect -re "$gdb_prompt $" {} } else { send_gdb "run\n" expect { - -re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" } + -re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" } -re "Starting program: .* No executable file specified.* -Use the \"file\" or \"exec-file\" command.*$prompt $"\ +Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\ { pass "run" } -re "Starting program: .* -No image loaded into target.*$prompt $"\ +No image loaded into target.*$gdb_prompt $"\ { pass "run" } -re "Starting program: .* -No program loaded.*$prompt $"\ +No program loaded.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } - -re "Don't know how to run. Try \"help target\"..*$prompt $"\ + -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\ { pass "run" } - -re ".*$prompt $" { fail "run" } + -re ".*$gdb_prompt $" { fail "run" } timeout { fail "(timeout) run" } } } @@ -417,13 +417,13 @@ gdb_test "rbreak" "" "rbreak" # an initial stack to be created. send_gdb "return\n" expect { - -re "No selected frame..*$prompt $"\ + -re "No selected frame..*$gdb_prompt $"\ { pass "return" } -re "Make .* return now.*y or n. $" { send_gdb "y\n" exp_continue } - -re ".*$prompt $" { fail "return" } + -re ".*$gdb_prompt $" { fail "return" } timeout { fail "(timeout) return" } } @@ -594,10 +594,10 @@ gdb_test "show print union" "Printing of unions interior to structures is on." " #test show print vtbl gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl" #test show prompt -# In the FAIL case, can't just look for $prompt because that will match -# the output, rather than the prompt. So look for $prompt at the start +# In the FAIL case, can't just look for $gdb_prompt because that will match +# the output, rather than the prompt. So look for $gdb_prompt at the start # of a line. -gdb_test "show prompt" "Gdb's prompt is \"$prompt \".*" "show prompt" +gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt" #test show radix gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix" #test show symbol-reloading @@ -647,34 +647,34 @@ gdb_test "target procfs" "Use the \"run\" command to start a Unix child process. #test target core send_gdb "target core\n" expect { - -re "No core file specified..*$prompt $" { pass "target core" } + -re "No core file specified..*$gdb_prompt $" { pass "target core" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } - expect -re "$prompt $" { } + expect -re "$gdb_prompt $" { } pass "target core" } - -re "Undefined target command: \"core\". Try \"help target\"..*$prompt $" { pass "target core" } - -re ".*$prompt $" { fail "target core" } + -re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" } + -re ".*$gdb_prompt $" { fail "target core" } timeout { fail "(timeout) target core" } } #test target exec send_gdb "target exec\n" expect { - -re "No exec file now..*$prompt $"\ + -re "No exec file now..*$gdb_prompt $"\ { pass "target exec" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } - expect -re "$prompt $" { } + expect -re "$gdb_prompt $" { } pass "target exec" } - -re ".*$prompt $" { fail "target exec" } + -re ".*$gdb_prompt $" { fail "target exec" } timeout { fail "(timeout) target exec" } } @@ -683,17 +683,17 @@ if ![istarget "*-*-udi*"] then { send_gdb "target remote\n" expect { -re "To open a remote debug connection, you need to specify what serial.* -device is attached to the remote system .e.g. /dev/ttya.*$prompt $"\ +device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\ { pass "target remote" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } - expect -re "$prompt $" { } + expect -re "$gdb_prompt $" { } pass "target remote" } - -re ".*$prompt $" { fail "target remote" } + -re ".*$gdb_prompt $" { fail "target remote" } timeout { fail "(timeout) target remote" } } } @@ -717,7 +717,7 @@ expect { -re "Delete all auto-display expressions.*y or n. $" { send_gdb "y\n" expect { - -re "$prompt $" { pass "undisplay prompt" } + -re "$gdb_prompt $" { pass "undisplay prompt" } timeout { fail "(timeout) (timeout) undisplay prompt" } } } @@ -730,7 +730,7 @@ expect { -re "Delete all environment variables?.*y or n. $" { send_gdb "y\n" expect { - -re "$prompt $" { pass "unset environmentprompt" } + -re "$gdb_prompt $" { pass "unset environmentprompt" } timeout { fail "(timeout) (timeout) unset environment prompt" } diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp index 2049058..2105367 100644 --- a/gdb/testsuite/gdb.base/help.exp +++ b/gdb/testsuite/gdb.base/help.exp @@ -282,7 +282,7 @@ gdb_test "help section" "Change the base address of section SECTION of the exec #test help set annotate gdb_test "help set annotate" "Set annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help set annotate" # test help set args -gdb_test "help set args" "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$prompt $" +gdb_test "help set args" "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Set arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$gdb_prompt $" gdb_test "help set args" # test help set check "c" abbreviation gdb_test "help set c" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"c\" abbreviation" @@ -374,7 +374,7 @@ gdb_test "help shell" "Execute the rest of the line as a shell command. .*\[\r\ #test help show annotate gdb_test "help show annotate" "Show annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help show annotate" # test help show args -gdb_test "help show args" "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$prompt $" +gdb_test "help show args" "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program." -re "Show arguments to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program..*$gdb_prompt $" gdb_test "help show args" # test help show check "c" abbreviation gdb_test "help show c" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check \"c\" abbreviation" diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp index aa9cc2e..2985870 100644 --- a/gdb/testsuite/gdb.base/interrupt.exp +++ b/gdb/testsuite/gdb.base/interrupt.exp @@ -82,23 +82,23 @@ if ![file exists $binfile] then { send_gdb "\003" expect { - -re "Program received signal SIGINT.*$prompt $" { + -re "Program received signal SIGINT.*$gdb_prompt $" { pass "send_gdb control C" } - -re ".*$prompt $" { fail "send_gdb control C" } + -re ".*$gdb_prompt $" { fail "send_gdb control C" } timeout { fail "send_gdb control C (timeout)" } eof { fail "send_gdb control C (eof)" } } send_gdb "p func1 ()\n" expect { - -re " = 4.*$prompt $" { pass "call function when asleep" } - -re ".*Program received signal SIGSEGV.*$prompt $" { + -re " = 4.*$gdb_prompt $" { pass "call function when asleep" } + -re ".*Program received signal SIGSEGV.*$gdb_prompt $" { setup_xfail "i*86-pc-linux*-gnu" fail "child died when we called func1, skipped rest of tests" return } - -re "$prompt $" { fail "call function when asleep (wrong output)" } + -re "$gdb_prompt $" { fail "call function when asleep (wrong output)" } default { # This fail probably happens whenever we use /proc (we @@ -137,7 +137,7 @@ if ![file exists $binfile] then { expect { -re "^continue\r\nContinuing.\r\n(\r\n|)$" { pass "continue" } -re "^continue\r\n\r\n" { fail "continue (missing Continuing.)" } - -re "$prompt $" { fail "continue" } + -re "$gdb_prompt $" { fail "continue" } timeout { fail "continue (timeout)" } eof { fail "continue (eof)" } } @@ -155,10 +155,10 @@ if ![file exists $binfile] then { setup_xfail "i*86-pc-linux*-gnu" send_gdb "\004" expect { - -re "end of file.*Program exited normally.*$prompt $" { + -re "end of file.*Program exited normally.*$gdb_prompt $" { pass "send_gdb end of file" } - -re "$prompt $" { fail "send end of file" } + -re "$gdb_prompt $" { fail "send end of file" } timeout { fail "send end of file (timeout)" } eof { fail "send end of file (eof)" } } diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index e0cf2c2..f718c99 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -49,7 +49,7 @@ if [get_compiler_info ${binfile}] { # proc set_listsize { arg } { - global prompt + global gdb_prompt if [gdb_test "set listsize $arg" "" "setting listsize to $arg"] { return 0; @@ -69,7 +69,7 @@ proc set_listsize { arg } { # proc test_listsize {} { - global prompt + global gdb_prompt # Show default size @@ -146,7 +146,7 @@ proc test_listsize {} { # proc test_list_include_file {} { - global prompt + global gdb_prompt # FIXME Fails for COFF as well, I think. setup_xfail "a29k-*-udi" @@ -162,40 +162,40 @@ proc test_list_include_file {} { # proc test_list_filename_and_number {} { - global prompt + global gdb_prompt set testcnt 0 send_gdb "list list0.c:1\n" expect { - -re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$prompt $" { + -re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list0.c:1" ; return } + -re ".*$gdb_prompt $" { fail "list list0.c:1" ; return } timeout { fail "list list0.c:1 (timeout)" ; return } } send_gdb "list list0.c:10\n" expect { - -re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$prompt $" { + -re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list.c:10" ; return } + -re ".*$gdb_prompt $" { fail "list list.c:10" ; return } timeout { fail "list list.c:10 (timeout)" ; return } } send_gdb "list list1.c:1\n" expect { - -re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$prompt $" { + -re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list1.c:1" ; return } + -re ".*$gdb_prompt $" { fail "list list1.c:1" ; return } timeout { fail "list list1.c:1 (timeout)" ; return } } send_gdb "list list1.c:12\n" expect { - -re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$prompt $" { + -re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list1.c:12" ; return } + -re ".*$gdb_prompt $" { fail "list list1.c:12" ; return } timeout { fail "list list1.c:12 (timeout)" ; return } } pass "list filename:number ($testcnt tests)" @@ -206,7 +206,7 @@ proc test_list_filename_and_number {} { # proc test_list_function {} { - global prompt + global gdb_prompt global gcc_compiled # gcc appears to generate incorrect debugging information for code @@ -227,35 +227,35 @@ proc test_list_function {} { } proc test_list_forward {} { - global prompt + global gdb_prompt set testcnt 0 send_gdb "list list0.c:10\n" expect { - -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list0.c:10" ; return } + -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list list0.c:10" ; return } timeout { fail "list list0.c:10 (timeout)" ; return } } send_gdb "list\n" expect { - -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 15-24" ; return } + -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 15-24" ; return } timeout { fail "list 15-24 (timeout)" ; return } } send_gdb "list\n" expect { - -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 25-34" ; return } + -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 25-34" ; return } timeout { fail "list 25-34 (timeout)" ; return } } send_gdb "list\n" expect { - -re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 35-42" ; return } + -re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 35-42" ; return } timeout { fail "list 35-42 (timeout)" ; return } } @@ -263,35 +263,35 @@ proc test_list_forward {} { } proc test_list_backwards {} { - global prompt + global gdb_prompt set testcnt 0 send_gdb "list list0.c:33\n" expect { - -re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list0.c:33" ; return } + -re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list list0.c:33" ; return } timeout { fail "list list0.c:33 (timeout)" ; return } } send_gdb "list -\n" expect { - -re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 18-27" ; return } + -re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 18-27" ; return } timeout { fail "list 18-27 (timeout)" ; return } } send_gdb "list -\n" expect { - -re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 8-17" ; return } + -re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 8-17" ; return } timeout { fail "list 8-17 (timeout)" ; return } } send_gdb "list -\n" expect { - -re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list 1-7" ; return } + -re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt } + -re ".*$gdb_prompt $" { fail "list 1-7" ; return } timeout { fail "list 1-7 (timeout)" ; return } } @@ -303,7 +303,7 @@ proc test_list_backwards {} { # proc test_list_range {} { - global prompt + global gdb_prompt gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2" @@ -325,7 +325,7 @@ proc test_list_range {} { # proc test_list_filename_and_function {} { - global prompt + global gdb_prompt set testcnt 0 @@ -335,13 +335,13 @@ proc test_list_filename_and_function {} { setup_xfail "a29k-*-udi" send_gdb "list list0.c:main\n" expect { - -re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$prompt $" { + -re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" { + -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { pass "list function in source file 1" } - -re ".*$prompt $" { fail "list list0.c:main" } + -re ".*$gdb_prompt $" { fail "list list0.c:main" } timeout { fail "list list0.c:main (timeout)" } } @@ -352,13 +352,13 @@ proc test_list_filename_and_function {} { setup_xfail "rs6000-*-aix*" send_gdb "list list0.c:unused\n" expect { - -re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$prompt $" { + -re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } - -re "37.*42\[ \t\]+\}\r\n$prompt $" { + -re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list0.c:unused" } + -re ".*$gdb_prompt $" { fail "list list0.c:unused" } timeout { fail "list list0.c:unused (timeout)" } } clear_xfail "rs6000-*-aix*" @@ -373,19 +373,19 @@ proc test_list_filename_and_function {} { setup_xfail "a29k-*-udi" send_gdb "list list0.h:foo\n" expect { - -re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" { + -re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" { + -re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" { + -re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } - -re "No source file named list0.h.\r\n$prompt $" { + -re "No source file named list0.h.\r\n$gdb_prompt $" { fail "list list0.h:foo" } - -re ".*$prompt $" { fail "list list0.h:foo" } + -re ".*$gdb_prompt $" { fail "list list0.h:foo" } timeout { fail "list list0.h:foo (timeout)" } } @@ -393,16 +393,16 @@ proc test_list_filename_and_function {} { # a29k-amd-udi is the third case. send_gdb "list list1.c:bar\n" expect { - -re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$prompt $" { + -re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } - -re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$prompt $" { + -re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$gdb_prompt $" { incr testcnt } - -re "1\[ \t\]+void.*9\[ \t\]*\r\n$prompt $" { + -re "1\[ \t\]+void.*9\[ \t\]*\r\n$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list1.c:bar" } + -re ".*$gdb_prompt $" { fail "list list1.c:bar" } timeout { fail "list list1.c:bar (timeout)" } } @@ -413,13 +413,13 @@ proc test_list_filename_and_function {} { setup_xfail "rs6000-*-aix*" send_gdb "list list1.c:unused\n" expect { - -re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$prompt $" { + -re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$gdb_prompt $" { incr testcnt } - -re "9.*14\[ \t\]+\}\r\n.*$prompt $" { + -re "9.*14\[ \t\]+\}\r\n.*$gdb_prompt $" { incr testcnt } - -re ".*$prompt $" { fail "list list1.c:unused" } + -re ".*$gdb_prompt $" { fail "list list1.c:unused" } timeout { fail "list list1.c:unused (timeout)" } } clear_xfail "rs6000-*-aix*" @@ -481,8 +481,8 @@ if [target_info exists use_gdb_stubs] { send_gdb "step\n" # if use stubs step out of the breakpoint() function. expect { - -re "main.* at .*$prompt $" {} - -re ".*in .*start.*$prompt $" {} + -re "main.* at .*$gdb_prompt $" {} + -re ".*in .*start.*$gdb_prompt $" {} timeout { fail "single step at breakpoint() (timeout)" ; return 0 } } } diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index b13fd79..024b5e8 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -38,7 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # fails, then we skip the other tests. proc set_lang_c {} { - global prompt + global gdb_prompt if [gdb_test "set language c" "" "set language c"] { return 0 @@ -51,7 +51,7 @@ proc set_lang_c {} { } proc test_integer_literals_accepted {} { - global prompt + global gdb_prompt # Test various decimal values. @@ -79,7 +79,7 @@ proc test_integer_literals_accepted {} { } proc test_character_literals_accepted {} { - global prompt + global gdb_prompt gdb_test "p 'a'" " = 97 'a'" gdb_test "p/c 'a'" " = 97 'a'" @@ -95,7 +95,7 @@ proc test_character_literals_accepted {} { } proc test_integer_literals_rejected {} { - global prompt + global gdb_prompt test_print_reject "p 0x" gdb_test "p ''" "Empty character constant\\." @@ -129,7 +129,7 @@ proc test_integer_literals_rejected {} { } proc test_print_all_chars {} { - global prompt + global gdb_prompt gdb_test "p ctable1\[0\]" " = 0 '\\\\000'" gdb_test "p ctable1\[1\]" " = 1 '\\\\001'" @@ -393,7 +393,7 @@ proc test_print_all_chars {} { # repeat count, set to the default of 10. proc test_print_repeats_10 {} { - global prompt + global gdb_prompt gdb_test "set print elements 1" "" gdb_test "p &ctable2\[0*16\]" " = \\(unsigned char \\*\\) \"a\"..." @@ -781,7 +781,7 @@ proc test_print_repeats_10 {} { } proc test_print_strings {} { - global prompt + global gdb_prompt # We accept "(unsigned char *) " before the string. char vs. unsigned char # is already tested elsewhere. @@ -875,7 +875,7 @@ proc test_print_strings {} { } proc test_print_int_arrays {} { - global prompt + global gdb_prompt gdb_test "set print elements 24" "" @@ -900,7 +900,7 @@ proc test_artificial_arrays {} { } proc test_print_char_arrays {} { - global prompt + global gdb_prompt global hex gdb_test "set print elements 24" "" @@ -925,7 +925,7 @@ proc test_print_char_arrays {} { } proc test_print_string_constants {} { - global prompt + global gdb_prompt gdb_test "set print elements 50" "" diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index 7bd9ca8..fec31eb 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -55,15 +55,15 @@ gdb_load ${binfile} send_gdb "ptype red1\n" expect { - -re "type = enum primary1_tag \{red1, green1, blue1\}.*$prompt $"\ + -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\ { # The workaround is in effect. As this is a compiler, not GDB, # bug, we'll make it a PASS but perhaps it should be an XFAIL. pass "ptype unnamed enumeration member (worked around)" } - -re "type = enum \{red1, green1, blue1\}.*$prompt $"\ + -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $"\ { pass "ptype unnamed enumeration member" } - -re ".*$prompt $" { fail "ptype unnamed enumeration member" } + -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" } timeout { fail "(timeout) ptype unnamed enumeration member" } } @@ -82,8 +82,8 @@ expect { (long|long int|int) v_long_member;.* float v_float_member;.* double v_double_member;.* -\}.*$prompt $" { pass "ptype structure" } - -re ".*$prompt $" { fail "ptype structure" } +\}.*$gdb_prompt $" { pass "ptype structure" } + -re ".*$gdb_prompt $" { fail "ptype structure" } timeout { fail "(timeout) ptype structure" } } @@ -117,8 +117,8 @@ expect { struct link \[*\]next;.* struct link \[*(\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.* struct t_struct stuff.1..2..3.;.* -\}.*$prompt $" { pass "ptype linked list structure" } - -re ".*$prompt $" { +\}.*$gdb_prompt $" { pass "ptype linked list structure" } + -re ".*$gdb_prompt $" { # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. @@ -141,8 +141,8 @@ expect { (long|long int|int) v_long_member;.* float v_float_member;.* double v_double_member;.* -\}.*$prompt $" { pass "ptype union" } - -re ".*$prompt $" { fail "ptype union" } +\}.*$gdb_prompt $" { pass "ptype union" } + -re ".*$gdb_prompt $" { fail "ptype union" } timeout { fail "(timeout) ptype union" } } @@ -153,8 +153,8 @@ expect { struct link \[*\]next;.* struct link \[(\*\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.* struct t_struct stuff.1..2..3.;.* -\}.*$prompt $" { pass "ptype linked list union" } - -re ".*$prompt $" { +\}.*$gdb_prompt $" { pass "ptype linked list union" } + -re ".*$gdb_prompt $" { # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. @@ -171,17 +171,17 @@ expect { send_gdb "ptype primary\n" expect { - -re "type = enum .red, green, blue.*$prompt $" { pass "ptype unnamed enumeration" } - -re ".*$prompt $" { fail "ptype unnamed enumeration" } + -re "type = enum .red, green, blue.*$gdb_prompt $" { pass "ptype unnamed enumeration" } + -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration" } timeout { fail "(timeout) ptype unnamed enumeration" } } send_gdb "ptype enum colors\n" expect { - -re "type = enum colors \{yellow, purple, pink\}.*$prompt $"\ + -re "type = enum colors \{yellow, purple, pink\}.*$gdb_prompt $"\ { pass "ptype named enumeration" } - -re ".*$prompt $" { fail "ptype named enumeration" } + -re ".*$gdb_prompt $" { fail "ptype named enumeration" } timeout { fail "(timeout) ptype named enumeration" } } @@ -191,8 +191,8 @@ expect { # send_gdb "ptype boolean\n" expect { - -re "type = enum \{FALSE, TRUE\}.*$prompt $" { pass "ptype unnamed typedef'd enumeration" } - -re ".*$prompt $" { fail "ptype unnamed typedef'd enumeration" } + -re "type = enum \{FALSE, TRUE\}.*$gdb_prompt $" { pass "ptype unnamed typedef'd enumeration" } + -re ".*$gdb_prompt $" { fail "ptype unnamed typedef'd enumeration" } timeout { fail "(timeout) ptype unnamed typedef'd enumeration" } } @@ -220,8 +220,8 @@ gdb_test "ptype t_union3" "type = union \{.* send_gdb "ptype enum bvals\n" expect { - -re "type = enum bvals \{false, true\}.*$prompt $" { pass "ptype named typedef'd enumf'd enum" } - -re ".*$prompt $" { fail "ptype named typedef'd enumeration" } + -re "type = enum bvals \{false, true\}.*$gdb_prompt $" { pass "ptype named typedef'd enumf'd enum" } + -re ".*$gdb_prompt $" { fail "ptype named typedef'd enumeration" } timeout { fail "(timeout) ptype named typedef'd enumeration" } } @@ -231,9 +231,9 @@ expect { # send_gdb "ptype enum misordered\n" expect { - -re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$prompt $"\ + -re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$gdb_prompt $"\ { pass "ptype misordered enumeration" } - -re ".*$prompt $" { fail "ptype misordered enumeration" } + -re ".*$gdb_prompt $" { fail "ptype misordered enumeration" } timeout { fail "(timeout) ptype misordered enumeration" } } @@ -243,18 +243,18 @@ expect { # send_gdb "ptype three\n" expect { - -re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$prompt $"\ + -re "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*$gdb_prompt $"\ { pass "ptype named enumeration member" } - -re ".*$prompt $" { fail "ptype named enumeration member" } + -re ".*$gdb_prompt $" { fail "ptype named enumeration member" } timeout { fail "(timeout) ptype named enumeration member" } } send_gdb "ptype red\n" expect { - -re "type = enum \{red, green, blue\}.*$prompt $"\ + -re "type = enum \{red, green, blue\}.*$gdb_prompt $"\ { pass "ptype unnamed enumeration member" } - -re ".*$prompt $" { fail "ptype unnamed enumeration member" } + -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" } timeout { fail "(timeout) ptype unnamed enumeration member" } } @@ -271,8 +271,8 @@ expect { #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*" #send "ptype v_char\n" #expect { -# -re "type = char.*$prompt $" { pass "ptype char" } -# -re ".*$prompt $" { fail "ptype char" } +# -re "type = char.*$gdb_prompt $" { pass "ptype char" } +# -re ".*$gdb_prompt $" { fail "ptype char" } # timeout { fail "(timeout) ptype char" } #} # @@ -280,104 +280,104 @@ expect { #setup_xfail "mips-*-*" "a29k-*-*" #send "ptype v_signed_char\n" #expect { -# -re "type = signed char.*$prompt $" { pass "ptype signed char" } -# -re ".*$prompt $" { fail "ptype signed char" } +# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" } +# -re ".*$gdb_prompt $" { fail "ptype signed char" } # timeout { fail "(timeout) ptype signed char" } #} # # #send "ptype v_unsigned_char\n" #expect { -# -re "type = unsigned char.*$prompt $" { pass "ptype unsigned char" } -# -re ".*$prompt $" { fail "ptype unsigned char" } +# -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned char" } # timeout { fail "(timeout) ptype unsigned char" } #} send_gdb "ptype v_short\n" expect { - -re "type = short(| int).*$prompt $" { pass "ptype short" } - -re ".*$prompt $" { fail "ptype short" } + -re "type = short(| int).*$gdb_prompt $" { pass "ptype short" } + -re ".*$gdb_prompt $" { fail "ptype short" } timeout { fail "(timeout) ptype short" } } #send "ptype v_signed_short\n" #expect { -# -re "type = short.*$prompt $" { pass "ptype signed short" } -# -re ".*$prompt $" { fail "ptype signed short" } +# -re "type = short.*$gdb_prompt $" { pass "ptype signed short" } +# -re ".*$gdb_prompt $" { fail "ptype signed short" } # timeout { fail "(timeout) ptype signed short" } #} # # #send "ptype v_unsigned_short\n" #expect { -# -re "type = unsigned short.*$prompt $" { pass "ptype unsigned short" } -# -re ".*$prompt $" { fail "ptype unsigned short" } +# -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned short" } # timeout { fail "(timeout) ptype unsigned short" } #} send_gdb "ptype v_int\n" expect { - -re "type = int.*$prompt $" { pass "ptype int" } - -re ".*$prompt $" { fail "ptype int" } + -re "type = int.*$gdb_prompt $" { pass "ptype int" } + -re ".*$gdb_prompt $" { fail "ptype int" } timeout { fail "(timeout) ptype int" } } #send "ptype v_signed_int\n" #expect { -# -re "type = int.*$prompt $" { pass "ptype signed int" } -# -re ".*$prompt $" { fail "ptype signed int" } +# -re "type = int.*$gdb_prompt $" { pass "ptype signed int" } +# -re ".*$gdb_prompt $" { fail "ptype signed int" } # timeout { fail "(timeout) ptype signed int" } #} # # #send "ptype v_unsigned_int\n" #expect { -# -re "type = unsigned int.*$prompt $" { pass "ptype unsigned int" } -# -re ".*$prompt $" { fail "ptype unsigned int" } +# -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned int" } # timeout { fail "(timeout) ptype unsigned int" } #} # # #send "ptype v_long\n" #expect { -# -re "type = long.*$prompt $" { pass "ptype long" } -# -re ".*$prompt $" { fail "ptype long" } +# -re "type = long.*$gdb_prompt $" { pass "ptype long" } +# -re ".*$gdb_prompt $" { fail "ptype long" } # timeout { fail "(timeout) ptype long" } #} # # #send "ptype v_signed_long\n" #expect { -# -re "type = long.*$prompt $" { pass "ptype signed long" } -# -re ".*$prompt $" { fail "ptype signed long" } +# -re "type = long.*$gdb_prompt $" { pass "ptype signed long" } +# -re ".*$gdb_prompt $" { fail "ptype signed long" } # timeout { fail "(timeout) ptype signed long" } #} # # #send "ptype v_unsigned_long\n" #expect { -# -re "type = unsigned long.*$prompt $" { pass "ptype unsigned long" } -# -re ".*$prompt $" { fail "ptype unsigned long" } +# -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned long" } # timeout { fail "(timeout) ptype unsigned long" } #} # # #send "ptype v_float\n" #expect { -# -re "type = float.*$prompt $" { pass "ptype float" } -# -re ".*$prompt $" { fail "ptype float" } +# -re "type = float.*$gdb_prompt $" { pass "ptype float" } +# -re ".*$gdb_prompt $" { fail "ptype float" } # timeout { fail "(timeout) ptype float" } #} # # #send "ptype v_double\n" #expect { -# -re "type = double.*$prompt $" { pass "ptype double" } -# -re ".*$prompt $" { fail "ptype double" } +# -re "type = double.*$gdb_prompt $" { pass "ptype double" } +# -re ".*$gdb_prompt $" { fail "ptype double" } # timeout { fail "(timeout) ptype double" } #} @@ -389,8 +389,8 @@ expect { #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*" #send "ptype v_char_array\n" #expect { -# -re "type = char .2..*$prompt $" { pass "ptype char array" } -# -re ".*$prompt $" { fail "ptype char array" } +# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" } +# -re ".*$gdb_prompt $" { fail "ptype char array" } # timeout { fail "(timeout) ptype char array" } #} # @@ -398,16 +398,16 @@ expect { #setup_xfail "mips-*-*" "a29k-*-*" #send "ptype v_signed_char_array\n" #expect { -# -re "type = (|signed )char .2..*$prompt $" { pass "ptype signed char array" } -# -re ".*$prompt $" { fail "ptype signed char array" } +# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" } +# -re ".*$gdb_prompt $" { fail "ptype signed char array" } # timeout { fail "(timeout) ptype signed char array" } #} # # #send "ptype v_unsigned_char_array\n" #expect { -# -re "type = unsigned char .2..*$prompt $" { pass "ptype unsigned char array" } -# -re ".*$prompt $" { fail "ptype unsigned char array" } +# -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned char array" } # timeout { fail "(timeout) ptype unsigned char array" } #} # @@ -415,66 +415,66 @@ expect { # #send "ptype v_int_array\n" #expect { -# -re "type = int .2..*$prompt $" { pass "ptype int array" } -# -re ".*$prompt $" { fail "ptype int array" } +# -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" } +# -re ".*$gdb_prompt $" { fail "ptype int array" } # timeout { fail "(timeout) ptype int array" } #} # # #send "ptype v_signed_int_array\n" #expect { -# -re "type = int .2..*$prompt $" { pass "ptype signed int array" } -# -re ".*$prompt $" { fail "ptype signed int array" } +# -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" } +# -re ".*$gdb_prompt $" { fail "ptype signed int array" } # timeout { fail "(timeout) ptype signed int array" } #} # # #send "ptype v_unsigned_int_array\n" #expect { -# -re "type = unsigned int .2..*$prompt $" { pass "ptype unsigned int array" } -# -re ".*$prompt $" { fail "ptype unsigned int array" } +# -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned int array" } # timeout { fail "(timeout) ptype unsigned int array" } #} # # #send "ptype v_long_array\n" #expect { -# -re "type = (long|int|long int) .2..*$prompt $" { +# -re "type = (long|int|long int) .2..*$gdb_prompt $" { # pass "ptype long array" } -# -re ".*$prompt $" { fail "ptype long array" } +# -re ".*$gdb_prompt $" { fail "ptype long array" } # timeout { fail "(timeout) ptype long array" } #} # # #send "ptype v_signed_long_array\n" #expect { -# -re "type = (long|int|long int) .2..*$prompt $" { +# -re "type = (long|int|long int) .2..*$gdb_prompt $" { # pass "ptype signed long array" } -# -re ".*$prompt $" { fail "ptype signed long array" } +# -re ".*$gdb_prompt $" { fail "ptype signed long array" } # timeout { fail "(timeout) ptype signed long array" } #} # # #send "ptype v_unsigned_long_array\n" #expect { -# -re "type = unsigned long .2..*$prompt $" { pass "ptype unsigned long array" } -# -re ".*$prompt $" { fail "ptype unsigned long array" } +# -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned long array" } # timeout { fail "(timeout) ptype unsigned long array" } #} # # #send "ptype v_float_array\n" #expect { -# -re "type = float .2..*$prompt $" { pass "ptype float array" } -# -re ".*$prompt $" { fail "ptype float array" } +# -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" } +# -re ".*$gdb_prompt $" { fail "ptype float array" } # timeout { fail "(timeout) ptype float array" } #} # # #send "ptype v_double_array\n" #expect { -# -re "type = double .2..*$prompt $" { pass "ptype double array" } -# -re ".*$prompt $" { fail "ptype double array" } +# -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" } +# -re ".*$gdb_prompt $" { fail "ptype double array" } # timeout { fail "(timeout) ptype double array" } #} # @@ -490,8 +490,8 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*" #send "ptype v_char_pointer\n" #expect { -# -re "type = char \*.*$prompt $" { pass "ptype char pointer" } -# -re ".*$prompt $" { fail "ptype char pointer" } +# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" } +# -re ".*$gdb_prompt $" { fail "ptype char pointer" } # timeout { fail "(timeout) ptype char pointer" } #} # @@ -499,105 +499,105 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" #setup_xfail "mips-*-*" "a29k-*-*" #send "ptype v_signed_char_pointer\n" #expect { -# -re "type = (|signed )char \*.*$prompt $" +# -re "type = (|signed )char \*.*$gdb_prompt $" # { pass "ptype signed char pointer" } -# -re ".*$prompt $" { fail "ptype signed char pointer" } +# -re ".*$gdb_prompt $" { fail "ptype signed char pointer" } # timeout { fail "(timeout) ptype signed char pointer" } #} # # #send "ptype v_unsigned_char_pointer\n" #expect { -# -re "type = unsigned char \*.*$prompt $" { pass "ptype unsigned char pointer" } -# -re ".*$prompt $" { fail "ptype unsigned char pointer" } +# -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" } # timeout { fail "(timeout) ptype unsigned char pointer" } #} # # #send "ptype v_short_pointer\n" #expect { -# -re "type = (short|short int) \*.*$prompt $" { pass "ptype short pointer" } -# -re ".*$prompt $" { fail "ptype short pointer" } +# -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" } +# -re ".*$gdb_prompt $" { fail "ptype short pointer" } # timeout { fail "(timeout) ptype short pointer" } #} # # #send "ptype v_signed_short_pointer\n" #expect { -# -re "type = short \*.*$prompt $" { pass "ptype signed short pointer" } -# -re ".*$prompt $" { fail "ptype signed short pointer" } +# -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" } +# -re ".*$gdb_prompt $" { fail "ptype signed short pointer" } # timeout { fail "(timeout) ptype signed short pointer" } #} # # #send "ptype v_unsigned_short_pointer\n" #expect { -# -re "type = unsigned short \*.*$prompt $" { pass "ptype unsigned short pointer" } -# -re ".*$prompt $" { fail "ptype unsigned short pointer" } +# -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" } # timeout { fail "(timeout) ptype unsigned short pointer" } #} # # #send "ptype v_int_pointer\n" #expect { -# -re "type = int \*.*$prompt $" { pass "ptype int pointer" } -# -re ".*$prompt $" { fail "ptype int pointer" } +# -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" } +# -re ".*$gdb_prompt $" { fail "ptype int pointer" } # timeout { fail "(timeout) ptype int pointer" } #} # # #send "ptype v_signed_int_pointer\n" #expect { -# -re "type = int \*.*$prompt $" { pass "ptype signed int pointer" } -# -re ".*$prompt $" { fail "ptype signed int pointer" } +# -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" } +# -re ".*$gdb_prompt $" { fail "ptype signed int pointer" } # timeout { fail "(timeout) ptype signed int pointer" } #} # # #send "ptype v_unsigned_int_pointer\n" #expect { -# -re "type = unsigned int \*.*$prompt $" { pass "ptype unsigned int pointer" } -# -re ".*$prompt $" { fail "ptype unsigned int pointer" } +# -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" } # timeout { fail "(timeout) ptype unsigned int pointer" } #} # # #send "ptype v_long_pointer\n" #expect { -# -re "type = long \*.*$prompt $" { pass "ptype long pointer" } -# -re ".*$prompt $" { fail "ptype long pointer" } +# -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" } +# -re ".*$gdb_prompt $" { fail "ptype long pointer" } # timeout { fail "(timeout) ptype long pointer" } #} # # #send "ptype v_signed_long_pointer\n" #expect { -# -re "type = long \*.*$prompt $" { pass "ptype signed long pointer" } -# -re ".*$prompt $" { fail "ptype signed long pointer" } +# -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" } +# -re ".*$gdb_prompt $" { fail "ptype signed long pointer" } # timeout { fail "(timeout) ptype signed long pointer" } #} # # #send "ptype v_unsigned_long_pointer\n" #expect { -# -re "type = unsigned long \*.*$prompt $" { pass "ptype unsigned long pointer" } -# -re ".*$prompt $" { fail "ptype unsigned long pointer" } +# -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" } +# -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" } # timeout { fail "(timeout) ptype unsigned long pointer" } #} # # #send "ptype v_float_pointer\n" #expect { -# -re "type = float \*.*$prompt $" { pass "ptype float pointer" } -# -re ".*$prompt $" { fail "ptype float pointer" } +# -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" } +# -re ".*$gdb_prompt $" { fail "ptype float pointer" } # timeout { fail "(timeout) ptype float pointer" } #} # # #send "ptype v_double_pointer\n" #expect { -# -re "type = double \*.*$prompt $" { pass "ptype double pointer" } -# -re ".*$prompt $" { fail "ptype double pointer" } +# -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" } +# -re ".*$gdb_prompt $" { fail "ptype double pointer" } # timeout { fail "(timeout) ptype double pointer" } #} @@ -611,8 +611,8 @@ expect { struct inner_struct inner_struct_instance;.* union inner_union inner_union_instance;.* (long|long int|int) outer_long;.* -\}.*$prompt $" { pass "ptype outer structure" } - -re ".*$prompt $" { fail "ptype outer structure" } +\}.*$gdb_prompt $" { pass "ptype outer structure" } + -re ".*$gdb_prompt $" { fail "ptype outer structure" } timeout { fail "(timeout) ptype outer structure" } } @@ -622,8 +622,8 @@ expect { -re "type = struct inner_struct \{.* int inner_int;.* (long|long int|int) inner_long;.* -\}.*$prompt $" { pass "ptype inner structure" } - -re ".*$prompt $" { fail "ptype inner structure" } +\}.*$gdb_prompt $" { pass "ptype inner structure" } + -re ".*$gdb_prompt $" { fail "ptype inner structure" } timeout { fail "(timeout) ptype inner structure" } } @@ -633,8 +633,8 @@ expect { -re "type = union inner_union \{.* int inner_union_int;.* (long|long int|int) inner_union_long;.* -\}.*$prompt $" { pass "ptype inner union" } - -re ".*$prompt $" { fail "ptype inner union" } +\}.*$gdb_prompt $" { pass "ptype inner union" } + -re ".*$gdb_prompt $" { fail "ptype inner union" } timeout { fail "(timeout) ptype inner union" } } @@ -646,16 +646,16 @@ expect { struct inner_struct inner_struct_instance;.* union inner_union inner_union_instance;.* (long|long int|int) outer_long;.* -\}.*$prompt $" { pass "ptype nested structure" } - -re ".*$prompt $" { fail "ptype nested structure" } +\}.*$gdb_prompt $" { pass "ptype nested structure" } + -re ".*$gdb_prompt $" { fail "ptype nested structure" } timeout { fail "(timeout) ptype nested structure" } } send_gdb "ptype nested_su.outer_int\n" expect { - -re "type = int.*$prompt $" { pass "ptype outer int" } - -re ".*$prompt $" { fail "ptype outer int" } + -re "type = int.*$gdb_prompt $" { pass "ptype outer int" } + -re ".*$gdb_prompt $" { fail "ptype outer int" } timeout { fail "(timeout) ptype outer int" } } @@ -665,16 +665,16 @@ expect { -re "type = struct inner_struct \{.* int inner_int;.* (long|long int|int) inner_long;.* -\}.*$prompt $" { pass "ptype nested structure" } - -re ".*$prompt $" { fail "ptype nested structure" } +\}.*$gdb_prompt $" { pass "ptype nested structure" } + -re ".*$gdb_prompt $" { fail "ptype nested structure" } timeout { fail "(timeout) ptype nested structure" } } send_gdb "ptype nested_su.inner_struct_instance.inner_int\n" expect { - -re "type = int.*$prompt $" { pass "ptype inner int" } - -re ".*$prompt $" { fail "ptype inner int" } + -re "type = int.*$gdb_prompt $" { pass "ptype inner int" } + -re ".*$gdb_prompt $" { fail "ptype inner int" } timeout { fail "(timeout) ptype inner int" } } @@ -684,8 +684,8 @@ expect { -re "type = union inner_union \{.* int inner_union_int;.* (long|long int|int) inner_union_long;.* -\}.*$prompt $" { pass "ptype nested union" } - -re ".*$prompt $" { fail "ptype nested union" } +\}.*$gdb_prompt $" { pass "ptype nested union" } + -re ".*$gdb_prompt $" { fail "ptype nested union" } timeout { fail "(timeout) ptype nested union" } } diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp index 2feef72..7ff717d 100644 --- a/gdb/testsuite/gdb.base/setvar.exp +++ b/gdb/testsuite/gdb.base/setvar.exp @@ -52,7 +52,7 @@ gdb_load $binfile # # set it up at a breakpoint so we canplay with the variable values # -send_gdb "set print sevenbit-strings\n" ; expect -re "$prompt $" +send_gdb "set print sevenbit-strings\n" ; expect -re "$gdb_prompt $" if ![runto_main] then { perror "couldn't run to breakpoint" @@ -66,19 +66,19 @@ set ulong_minus_1 4294967295 set ulong_minus_456 4294966840 send_gdb "print sizeof (unsigned long)\n" expect { - -re ".\[0-9\]* = 4.*$prompt $" {} - -re ".\[0-9\]* = 8.*$prompt $" { + -re ".\[0-9\]* = 4.*$gdb_prompt $" {} + -re ".\[0-9\]* = 8.*$gdb_prompt $" { set ulong_minus_1 18446744073709551615 set ulong_minus_456 18446744073709551160 } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "getting sizeof unsigned long" } default { fail "(timeout) getting sizeof unsigned long" } } proc test_set { args } { - global prompt + global gdb_prompt set length [expr [llength $args] - 3]; set print_cmd "[lindex $args $length]"; diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp index 80cd3b6..d483788 100644 --- a/gdb/testsuite/gdb.base/sigall.exp +++ b/gdb/testsuite/gdb.base/sigall.exp @@ -44,7 +44,7 @@ set thissig "ABRT" proc test_one_sig {nextsig} { global sig_supported - global prompt + global gdb_prompt global thissig set this_sig_supported $sig_supported @@ -61,10 +61,10 @@ proc test_one_sig {nextsig} { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } expect { - -re "Continuing.*Program received signal SIG$thissig.*$prompt $" { + -re "Continuing.*Program received signal SIG$thissig.*$gdb_prompt $" { pass "get signal $thissig" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "get signal $thissig" set need_another_continue 0 } @@ -95,10 +95,10 @@ proc test_one_sig {nextsig} { setup_xfail "*-*-*lynx*" } expect { - -re "Breakpoint.*handle_$thissig.*$prompt $" { + -re "Breakpoint.*handle_$thissig.*$gdb_prompt $" { pass "send signal $thissig" } - -re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" { + -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" { fail "missed breakpoint at handle_$thissig" set missed_handler 1 } @@ -108,15 +108,15 @@ proc test_one_sig {nextsig} { if { $missed_handler == "0" } then { send_gdb "signal 0\n" expect { - -re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" { + -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" { pass "advance to $nextsig" set sig_supported 1 } - -re "Breakpoint.*gen_$nextsig.*handle.*$prompt $" { + -re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" { pass "advance to $nextsig" set sig_supported 0 } - -re ".*$prompt $" { fail "advance to $nextsig" } + -re ".*$gdb_prompt $" { fail "advance to $nextsig" } default { fail "advance to $nextsig (eof or timeout)" } } } diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp index 88f9a5c..fae0f71 100644 --- a/gdb/testsuite/gdb.base/structs.exp +++ b/gdb/testsuite/gdb.base/structs.exp @@ -65,7 +65,7 @@ if [istarget "a29k-*-udi"] then { proc do_function_calls {} { global prototypes global gcc_compiled - global prompt + global gdb_prompt # First, call the "fun" functions and examine the value they return. gdb_test "p fun1()" " = {a = 49 '1'}" @@ -129,9 +129,9 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -send_gdb "set print sevenbit-strings\n" ; expect -re "$prompt $" -send_gdb "set print address off\n" ; expect -re "$prompt $" -send_gdb "set width 0\n" ; expect -re "$prompt $" +send_gdb "set print sevenbit-strings\n" ; expect -re "$gdb_prompt $" +send_gdb "set print address off\n" ; expect -re "$gdb_prompt $" +send_gdb "set width 0\n" ; expect -re "$gdb_prompt $" if [runto_main] then { do_function_calls diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 616fb63..2b34c41 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -51,42 +51,42 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # 3 Watchpoint ival3 proc initialize {} { - global prompt + global gdb_prompt global hex global decimal global srcfile send_gdb "break marker1\n" expect { - -re "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*$prompt $" { + -re "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*$gdb_prompt $" { pass "set breakpoint at marker1" } - -re ".*$prompt $" { fail "set breakpoint at marker1" ; return 0 } + -re ".*$gdb_prompt $" { fail "set breakpoint at marker1" ; return 0 } timeout { fail "set breakpoint at marker1 (timeout)" ; return 0 } } send_gdb "break marker2\n" expect { - -re "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*$prompt $" { + -re "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*$gdb_prompt $" { pass "set breakpoint at marker2" } - -re ".*$prompt $" { fail "set breakpoint at marker2" ; return 0 } + -re ".*$gdb_prompt $" { fail "set breakpoint at marker2" ; return 0 } timeout { fail "set breakpoint at marker2 (timeout)" ; return 0 } } send_gdb "info break\n" expect { - -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n$prompt $" { pass "info break in watchpoint.exp" } - -re ".*$prompt $" { fail "info break in watchpoint.exp" ; return 0 } + -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n$gdb_prompt $" { pass "info break in watchpoint.exp" } + -re ".*$gdb_prompt $" { fail "info break in watchpoint.exp" ; return 0 } timeout { fail "info break in watchpoint.exp (timeout)" ; return 0 } } send_gdb "watch ival3\n" expect { - -re ".*\[Ww\]atchpoint 3: ival3\r\n$prompt $" { + -re ".*\[Ww\]atchpoint 3: ival3\r\n$gdb_prompt $" { pass "set watchpoint on ival3" } - -re ".*$prompt $" { fail "set watchpoint on ival3" ; return 0 } + -re ".*$gdb_prompt $" { fail "set watchpoint on ival3" ; return 0 } timeout { fail "set watchpoint on ival3 (timeout)" ; return 0 } } @@ -94,10 +94,10 @@ proc initialize {} { send_gdb "info watch\n" expect { - -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$prompt $" { + -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$gdb_prompt $" { pass "watchpoint found in watchpoint/breakpoint table" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "watchpoint found in watchpoint/breakpoint table" ; return 0 } timeout { @@ -111,8 +111,8 @@ proc initialize {} { send_gdb "disable 3\n" expect { - -re "disable 3\[\r\n\]+$prompt $" { pass "disable watchpoint" } - -re ".*$prompt $" { fail "disable watchpoint" ; return 0 } + -re "disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint" } + -re ".*$gdb_prompt $" { fail "disable watchpoint" ; return 0 } timeout { fail "disable watchpoint (timeout)" ; return 0 } } @@ -124,7 +124,7 @@ proc initialize {} { # proc test_simple_watchpoint {} { - global prompt + global gdb_prompt global hex global decimal global noresults @@ -133,10 +133,10 @@ proc test_simple_watchpoint {} { send_gdb "disable 3\n" expect { - -re "^disable 3\[\r\n\]+$prompt $" { + -re "^disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint in test_simple_watchpoint" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "disable watchpoint in test_simple_watchpoint" return 0 } @@ -151,10 +151,10 @@ proc test_simple_watchpoint {} { gdb_run_cmd set timeout 600 expect { - -re "Breakpoint 1, marker1 .*$prompt $" { + -re "Breakpoint 1, marker1 .*$gdb_prompt $" { pass "run to marker1 in test_simple_watchpoint" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run to marker1 in test_simple_watchpoint" return } @@ -168,8 +168,8 @@ proc test_simple_watchpoint {} { send_gdb "enable 3\n" expect { - -re "^enable 3\[\r\n\]+$prompt $" { pass "enable watchpoint" } - -re ".*$prompt $" { fail "enable watchpoint" ; return } + -re "^enable 3\[\r\n\]+$gdb_prompt $" { pass "enable watchpoint" } + -re ".*$gdb_prompt $" { fail "enable watchpoint" ; return } timeout { fail "enable watchpoint (timeout)" ; return } } @@ -183,10 +183,10 @@ proc test_simple_watchpoint {} { send_gdb "cont\n" expect { - -re "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*$prompt $" { + -re "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*$gdb_prompt $" { pass "watchpoint hit, first time" } - -re "Continuing.*Breakpoint.*func1.*$prompt $" { + -re "Continuing.*Breakpoint.*func1.*$gdb_prompt $" { setup_xfail "m68*-*-*" 2597 fail "thought it hit breakpoint at func1 twice" gdb_test "delete \$func1_breakpoint_number" "" @@ -194,7 +194,7 @@ proc test_simple_watchpoint {} { Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count;" \ "watchpoint hit, first time" } - -re ".*$prompt $" { fail "watchpoint hit, first time" ; return } + -re ".*$gdb_prompt $" { fail "watchpoint hit, first time" ; return } timeout { fail "watchpoint hit, first time (timeout)" ; return } eof { fail "watchpoint hit, first time (eof)" ; return } } @@ -225,8 +225,8 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count send_gdb "disable 3\n" expect { - -re "^disable 3\[\r\n\]+$prompt $" { pass "watchpoint disabled" } - -re ".*$prompt $" { fail "watchpoint disabled" ; return } + -re "^disable 3\[\r\n\]+$gdb_prompt $" { pass "watchpoint disabled" } + -re ".*$gdb_prompt $" { fail "watchpoint disabled" ; return } timeout { fail "watchpoint disabled (timeout)" ; return } } @@ -241,7 +241,7 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count # Test disabling watchpoints. proc test_disabling_watchpoints {} { - global prompt + global gdb_prompt global binfile global srcfile global decimal @@ -252,10 +252,10 @@ proc test_disabling_watchpoints {} { send_gdb "disable 3\n" expect { - -re "^disable 3\[\r\n\]+$prompt $" { + -re "^disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint in test_disabling_watchpoints" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "disable watchpoint in test_disabling_watchpoints" return 0 } @@ -270,10 +270,10 @@ proc test_disabling_watchpoints {} { gdb_run_cmd set timeout 600 expect { - -re "Breakpoint 1, marker1 .*$prompt $" { + -re "Breakpoint 1, marker1 .*$gdb_prompt $" { pass "run to marker1 in test_disabling_watchpoints" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "run to marker1 in test_disabling_watchpoints" return } @@ -287,8 +287,8 @@ proc test_disabling_watchpoints {} { send_gdb "enable 3\n" expect { - -re "^enable 3\[\r\n\]+$prompt $" { pass "watchpoint enabled" } - -re ".*$prompt $" { fail "watchpoint enabled" ; return } + -re "^enable 3\[\r\n\]+$gdb_prompt $" { pass "watchpoint enabled" } + -re ".*$gdb_prompt $" { fail "watchpoint enabled" ; return } timeout { fail "watchpoint enabled (timeout)" ; return } } @@ -304,10 +304,10 @@ proc test_disabling_watchpoints {} { send_gdb "disable 3\n" expect { - -re "^disable 3\[\r\n\]+$prompt $" { + -re "^disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint #2 in test_disabling_watchpoints" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { "disable watchpoint #2 in test_disabling_watchpoints" return 0 } @@ -334,7 +334,7 @@ proc test_disabling_watchpoints {} { # Test stepping and other mundane operations with watchpoints enabled proc test_stepping {} { - global prompt + global gdb_prompt if [runto marker1] then { gdb_test "watch ival2" ".*\[Ww\]atchpoint \[0-9\]*: ival2" @@ -383,14 +383,14 @@ proc test_stepping {} { default { fail "finish from marker1" ; return } } expect { - -re "marker1 \\(\\);.*$prompt $" { + -re "marker1 \\(\\);.*$gdb_prompt $" { send_gdb "step\n" exp_continue } - -re "func1 \\(\\);.*$prompt $" { + -re "func1 \\(\\);.*$gdb_prompt $" { pass "finish from marker1" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "finish from marker1" } default { fail "finish from marker1" ; return } @@ -411,14 +411,14 @@ proc test_stepping {} { gdb_test "until" "ival3 = count.*" "until to ival3 assignment" send_gdb "until\n" expect { - -re "(for \\(count = 0|\}).*$prompt $" { + -re "(for \\(count = 0|\}).*$gdb_prompt $" { gdb_test "until" "ival1 = count; /. Outside loop ./" \ "until out of loop" } - -re "ival1 = count; /. Outside loop ./.*$prompt $" { + -re "ival1 = count; /. Outside loop ./.*$gdb_prompt $" { pass "until out of loop" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "until out of loop" } default { fail "until out of loop" ; return } @@ -430,7 +430,7 @@ proc test_stepping {} { # Test stepping and other mundane operations with watchpoints enabled proc test_watchpoint_triggered_in_syscall {} { - global prompt + global gdb_prompt global noinferiorio global noresults @@ -468,7 +468,7 @@ proc test_watchpoint_triggered_in_syscall {} { -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } - -re ".*$prompt $" { pass "sent 123" } + -re ".*$gdb_prompt $" { pass "sent 123" } timeout { fail "sent 123 (timeout)" } } @@ -476,30 +476,30 @@ proc test_watchpoint_triggered_in_syscall {} { # should have printed. send_gdb "print buf\[0\]\n" expect { - -re ".*= 49.*$prompt $" { set y [expr $y+1]; pass "print buf\[0\]"} - -re ".*= 0.*$prompt $" { pass "print buf\[0\]"} - -re ".*$prompt $" { fail "print buf\[0\]"} + -re ".*= 49.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[0\]"} + -re ".*= 0.*$gdb_prompt $" { pass "print buf\[0\]"} + -re ".*$gdb_prompt $" { fail "print buf\[0\]"} default { fail "print buf\[0\]"} } send_gdb "print buf\[1\]\n" expect { - -re ".*= 50.*$prompt $" { set y [expr $y+1]; pass "print buf\[1\]"} - -re ".*= 0.*$prompt $" { pass "print buf\[1\]"} - -re ".*$prompt $" { fail "print buf\[1\]"} + -re ".*= 50.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[1\]"} + -re ".*= 0.*$gdb_prompt $" { pass "print buf\[1\]"} + -re ".*$gdb_prompt $" { fail "print buf\[1\]"} default { fail "print buf\[1\]"} } send_gdb "print buf\[2\]\n" expect { - -re ".*= 51.*$prompt $" { set y [expr $y+1]; pass "print buf\[2\]"} - -re ".*= 0.*$prompt $" { pass "print buf\[2\]"} - -re ".*$prompt $" { fail "print buf\[2\]"} + -re ".*= 51.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[2\]"} + -re ".*= 0.*$gdb_prompt $" { pass "print buf\[2\]"} + -re ".*$gdb_prompt $" { fail "print buf\[2\]"} default { fail "print buf\[2\]"} } send_gdb "print buf\[3\]\n" expect { - -re ".*= 10.*$prompt $" { set y [expr $y+1]; pass "print buf\[3\]"} - -re ".*= 0.*$prompt $" { pass "print buf\[3\]"} - -re ".*$prompt $" { fail "print buf\[3\]" } + -re ".*= 10.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[3\]"} + -re ".*= 0.*$gdb_prompt $" { pass "print buf\[3\]"} + -re ".*$gdb_prompt $" { fail "print buf\[3\]" } default { fail "print buf\[3\]" } } @@ -525,7 +525,7 @@ proc test_watchpoint_triggered_in_syscall {} { # itself changes. Should add some more complicated stuff here. proc test_complex_watchpoint {} { - global prompt + global gdb_prompt global noresults if [runto marker4] then { |