public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed 1/2] [gdb/testsuite] Fix gdb.base/include-main.exp with -readnow
@ 2021-12-09 10:15 Tom de Vries
  2021-12-09 10:15 ` [pushed 2/2] [gdb/testsuite] Fix gdb.base/maint.exp " Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-12-09 10:15 UTC (permalink / raw)
  To: gdb-patches

With test-case gdb.base/include-main.exp and target board readnow, I run into:
...
FAIL: gdb.base/include-main.exp: maint info symtab
...

The corresponding check in gdb.base/include-main.exp:
...
gdb_test_no_output "maint info symtab"
...
checks that no CU was expanded, while -readnow ensures that all CUs are
expanded.

Fix this by skipping the check with -readnow.

Tested on x86_64-linux, with native and target board readnow.
---
 gdb/testsuite/gdb.base/include-main.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/include-main.exp b/gdb/testsuite/gdb.base/include-main.exp
index 5e5e9495198..28c0a3b4cfa 100644
--- a/gdb/testsuite/gdb.base/include-main.exp
+++ b/gdb/testsuite/gdb.base/include-main.exp
@@ -32,8 +32,10 @@ gdb_test_no_output "set language c"
 
 gdb_load $binfile
 
-# Verify that no CU was expanded.
-gdb_test_no_output "maint info symtab"
+if { ! [readnow] } {
+    # Verify that no CU was expanded.
+    gdb_test_no_output "maint info symtab"
+}
 
 # List a line in include-main.c.  The tricky bit is that there's no code in
 # include-main.c, so the file should not occur in the .debug_line info.

base-commit: de3a913df6e0af6d6d88ecd308407971a44eae9e
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pushed 2/2] [gdb/testsuite] Fix gdb.base/maint.exp with -readnow
  2021-12-09 10:15 [pushed 1/2] [gdb/testsuite] Fix gdb.base/include-main.exp with -readnow Tom de Vries
@ 2021-12-09 10:15 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2021-12-09 10:15 UTC (permalink / raw)
  To: gdb-patches

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.
---
 gdb/testsuite/gdb.base/maint.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 667f3733c9a..1bf9b35638d 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
     }
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 10:15 [pushed 1/2] [gdb/testsuite] Fix gdb.base/include-main.exp with -readnow Tom de Vries
2021-12-09 10:15 ` [pushed 2/2] [gdb/testsuite] Fix gdb.base/maint.exp " Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).