* lib/gdb.exp (gdb_test): Between $pattern and $prompt, expect

only \r\n, not .*.  The test can pass .* as the last thing in
	$pattern if that is what it wants.  In addition to providing this
	flexibility, this change should speed up pattern matching in cases
	where the pattern already ended with .* (there were a number of
	them).  This change also helps catch bad patterns--in the old
	scheme the typo "char \*" instead of "char \\*" would pass.  Now
	it is caught.
	* Many .exp files: Update callers.
This commit is contained in:
Jim Kingdon
1995-03-14 21:25:19 +00:00
parent 35f37e1e66
commit 4081daa1ed
11 changed files with 276 additions and 286 deletions

View File

@@ -50,7 +50,7 @@ proc default_gdb_version {} {
global GDB
global GDBFLAGS
if {[which $GDB] != 0} then {
set tmp [exec echo "q" | $GDB -nw]
set tmp [exec echo "q" | $GDB -nw $GDBFLAGS]
regexp " \[0-9\.\]+" $tmp version
clone_output "[which $GDB] version$version -nw $GDBFLAGS \n"
} else {
@@ -237,7 +237,7 @@ proc gdb_test { args } {
gdb_start
set result -1
}
-re "$pattern.*$prompt $" {
-re "$pattern\r\n$prompt $" {
if ![string match "" $message] then {
pass "$message"
}
@@ -296,9 +296,7 @@ proc gdb_test { args } {
#
# This differs from gdb_test in a few ways: (1) handling of empty
# sendthis (I suspect test_print_accept callers never use this), (2)
# it tests for the " =" (that could easily be moved to the callers,
# (3) the pattern must be followed by \r\n and the prompt, not other
# garbage as in gdb_test (this feature seems kind of worthwhile).
# it tests for the " =" (that could easily be moved to the callers.
proc test_print_accept { args } {
global prompt
@@ -612,4 +610,6 @@ if ![info exists argv0] then {
}
}
proc skip_chill_tests {} {
return ![isnative]
}