mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
gdb/testsuite: tighten up some end-of-line patterns
Following on from the previous commit, I searched the testsuite for places where we did: set eol "<some pattern>" in most cases the <some pattern> could be replaced with "\r\n" though in the stabs test I've switched to using the multi_line proc as that seemed like a better choice. In gdb.ada/info_types.exp I did need to add an extra use of $eol as the previous pattern would match multiple newlines, and in this one place we were actually expecting to match multiple newlines. The tighter pattern only matches a single newline, so we now need to be explicit when multiple newlines are expected -- I think this is a good thing. All the tests are still passing for me after these changes. Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional
|
|||||||
|
|
||||||
clean_restart ${testfile}
|
clean_restart ${testfile}
|
||||||
|
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
set sp "\[ \t\]*"
|
set sp "\[ \t\]*"
|
||||||
|
|
||||||
# Here is the scenario:
|
# Here is the scenario:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ clean_restart ${testfile}
|
|||||||
# the regular expressions below.
|
# the regular expressions below.
|
||||||
set any_nb "\[0-9\]+"
|
set any_nb "\[0-9\]+"
|
||||||
set any_addr "0x\[0-9a-zA-Z\]+"
|
set any_addr "0x\[0-9a-zA-Z\]+"
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
set sp "\[ \t\]*"
|
set sp "\[ \t\]*"
|
||||||
|
|
||||||
set info_break_header "Num${sp}Type${sp}Disp${sp}Enb${sp}Address${sp}What"
|
set info_break_header "Num${sp}Type${sp}Disp${sp}Enb${sp}Address${sp}What"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ if {![runto "pack.adb:$bp_location"]} {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
|
|
||||||
set test "info locals"
|
set test "info locals"
|
||||||
gdb_test_multiple "$test" "$test" {
|
gdb_test_multiple "$test" "$test" {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ clean_restart ${testfile}
|
|||||||
|
|
||||||
# Some global variables used to simplify the maintenance of some of
|
# Some global variables used to simplify the maintenance of some of
|
||||||
# the regular expressions below.
|
# the regular expressions below.
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
set sp "\[ \t\]*"
|
set sp "\[ \t\]*"
|
||||||
|
|
||||||
set when "when"
|
set when "when"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ clean_restart ${testfile}
|
|||||||
|
|
||||||
set any_nb "\[0-9\]+"
|
set any_nb "\[0-9\]+"
|
||||||
set any_addr "0x\[0-9a-zA-Z\]+"
|
set any_addr "0x\[0-9a-zA-Z\]+"
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
set sp "\[ \t\]*"
|
set sp "\[ \t\]*"
|
||||||
|
|
||||||
if {![runto break_me]} {
|
if {![runto break_me]} {
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
|
|||||||
# when the Ada language is being used.
|
# when the Ada language is being used.
|
||||||
gdb_test "set lang ada" ""
|
gdb_test "set lang ada" ""
|
||||||
|
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
|
|
||||||
gdb_test "info types new_integer_type" \
|
gdb_test "info types new_integer_type" \
|
||||||
"All types matching regular expression \"new_integer_type\":${eol}File .*info_types.c:${eol}.*\tint"
|
"All types matching regular expression \"new_integer_type\":${eol}${eol}File .*info_types.c:${eol}.*\tint"
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
|
|
||||||
# Check the output of "info target". Note that we are not interested
|
# Check the output of "info target". Note that we are not interested
|
||||||
# in this case in checking the actual info, but rather to make sure that
|
# in this case in checking the actual info, but rather to make sure that
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
set eol "\[\r\n\]+"
|
set eol "\r\n"
|
||||||
set sp "\[ \t\]*"
|
set sp "\[ \t\]*"
|
||||||
|
|
||||||
clean_restart ${binfile}
|
clean_restart ${binfile}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ gdb_test "up" ".*main.*" "up from marker2"
|
|||||||
# Make sure that `Local' isn't in scope here; it's local to foobar.
|
# Make sure that `Local' isn't in scope here; it's local to foobar.
|
||||||
# setup_kfail "gdb/825"
|
# setup_kfail "gdb/825"
|
||||||
|
|
||||||
set eol "\[\t \]*\[\r\n\]+\[\t \]*"
|
set eol "\[\t \]*\r\n\[\t \]*"
|
||||||
gdb_test_multiple "ptype Local" "local out of scope" {
|
gdb_test_multiple "ptype Local" "local out of scope" {
|
||||||
-re "No symbol \"Local\" in current context.*${gdb_prompt} $" {
|
-re "No symbol \"Local\" in current context.*${gdb_prompt} $" {
|
||||||
pass "local out of scope"
|
pass "local out of scope"
|
||||||
|
|||||||
@@ -35,19 +35,21 @@ if {![runto_main]} {
|
|||||||
|
|
||||||
get_debug_format
|
get_debug_format
|
||||||
|
|
||||||
set eol "\[ \t\]*\[\n\r\]+"
|
gdb_test "ptype v1" \
|
||||||
|
[multi_line \
|
||||||
gdb_test "ptype v1" "type = struct a {$eol
|
"type = struct a {" \
|
||||||
int x;$eol
|
" int x;" \
|
||||||
int y;$eol
|
" int y;" \
|
||||||
}"
|
"}"]
|
||||||
|
|
||||||
if {[test_debug_format "stabs"]} {
|
if {[test_debug_format "stabs"]} {
|
||||||
setup_kfail "gdb/1602" *-*-*
|
setup_kfail "gdb/1602" *-*-*
|
||||||
}
|
}
|
||||||
gdb_test "ptype v2" "type = struct a {$eol
|
gdb_test "ptype v2" \
|
||||||
const char .c;$eol
|
[multi_line \
|
||||||
}"
|
"type = struct a {" \
|
||||||
|
" const char .c;" \
|
||||||
|
"}"]
|
||||||
|
|
||||||
if {[test_debug_format "stabs"]} {
|
if {[test_debug_format "stabs"]} {
|
||||||
setup_kfail "gdb/1603" *-*-*
|
setup_kfail "gdb/1603" *-*-*
|
||||||
|
|||||||
Reference in New Issue
Block a user