aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-12-09 11:15:34 +0100
committerTom de Vries <tdevries@suse.de>2021-12-09 11:15:34 +0100
commit6722ee73f78acd2e22166e6fe334a8b9d9a12c38 (patch)
tree7efab43555dacda72b912251bdba66c2b31d8ad7
parentfb44b07969b510488a5bd76759b7594445d37ab4 (diff)
downloadgdb-6722ee73f78acd2e22166e6fe334a8b9d9a12c38.zip
gdb-6722ee73f78acd2e22166e6fe334a8b9d9a12c38.tar.gz
gdb-6722ee73f78acd2e22166e6fe334a8b9d9a12c38.tar.bz2
[gdb/testsuite] Fix gdb.base/maint.exp with -readnow
With test-case gdb.base/maint.exp and target board -readnow, I run into: ... FAIL: gdb.base/maint.exp: maint info line-table w/o a file name ... The problem is that this and other regexps anchored using '^': ... -re "^$gdb_prompt $" { ... don't trigger because other regexps don't consume the entire preceding line. This is partly due to the addition of the IS-STMT column. Fix this by making the regexps consume entire lines. Tested on x86_64-linux with native and target board readnow, as well as check-read1 and check-readmore.
-rw-r--r--gdb/testsuite/gdb.base/maint.exp8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 667f373..1bf9b35 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -432,11 +432,11 @@ gdb_test "maint" \
set saw_srcfile 0
gdb_test_multiple "maint info line-table" \
"maint info line-table w/o a file name" {
- -re "symtab: \[^\n\r\]+${srcfile} \\(\\(struct symtab \\*\\) $hex\\)\r\nlinetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+ADDRESS" {
+ -re "symtab: \[^\n\r\]+${srcfile} \\(\\(struct symtab \\*\\) $hex\\)\r\nlinetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+ADDRESS\[^\r\n\]*" {
set saw_srcfile 1
exp_continue
}
- -re "symtab: \[^\n\r\]+ \\(\\(struct symtab \\*\\) $hex\\)\r\nlinetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+ADDRESS" {
+ -re "symtab: \[^\n\r\]+ \\(\\(struct symtab \\*\\) $hex\\)\r\nlinetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+ADDRESS\[^\r\n\]*" {
# Match each symtab to avoid overflowing expect's buffer.
exp_continue
}
@@ -444,7 +444,7 @@ gdb_test_multiple "maint info line-table" \
# For symtabs with no linetable.
exp_continue
}
- -re "^$decimal\[ \t\]+$decimal\[ \t\]+$hex\r\n" {
+ -re "^$decimal\[ \t\]+$decimal\[ \t\]+$hex\[^\r\n\]*\r\n" {
# Line table entries can be long too:
#
# INDEX LINE ADDRESS
@@ -462,7 +462,7 @@ gdb_test_multiple "maint info line-table" \
# Match each line to avoid overflowing expect's buffer.
exp_continue
}
- -re "^$decimal\[ \t\]+END\[ \t\]+$hex\r\n" {
+ -re "^$decimal\[ \t\]+END\[ \t\]+$hex\[^\r\n\]*\r\n" {
# Matches an end marker in the above.
exp_continue
}