From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix DUPLICATEs gdb.dwarf2/dw2-is-stmt.exp
Date: Fri, 24 Sep 2021 12:41:06 +0200 [thread overview]
Message-ID: <20210924104104.GA1555@delia> (raw)
Hi,
Fix these DUPLICATEs by using with_test_prefix:
...
DUPLICATE: gdb.dwarf2/dw2-is-stmt.exp: ensure we saw a valid line pattern, 1
DUPLICATE: gdb.dwarf2/dw2-is-stmt.exp: ensure we saw a valid line pattern, 2
...
Tested on x86_64-linux.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix DUPLICATEs gdb.dwarf2/dw2-is-stmt.exp
---
gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp | 100 +++++++++++++++++--------------
1 file changed, 54 insertions(+), 46 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
index bb0afe1c282..a226b6d7323 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
@@ -188,59 +188,67 @@ runto_main
# be a single instruction between line_label_1 and line_label_2, but
# we allow for up to 25 (just a random number).
-set i 0
-set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
- "get pc before stepi loop at line_label_1"]
-while { $pc < $ll2 } {
- incr i
- set line_changed -1
- gdb_test_multiple "stepi" "stepi until line_label_2, $i" {
- -re "main, set var to 99.*$gdb_prompt" {
- set line_changed 0
- }
- -re "main, set var to 0.*$gdb_prompt " {
- set line_changed 1
- }
- }
- gdb_assert { $line_changed != -1 } \
- "ensure we saw a valid line pattern, $i"
+with_test_prefix "stepi until line_label_2" {
+ set i 0
set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
- "get pc inside stepi loop from line_label_1, $i"]
- if { $ll2 == $pc } {
- gdb_assert { $line_changed } \
- "line must change at line_label_2"
- } else {
- gdb_assert { !$line_changed } \
- "line should not change until line_label_2, $i"
+ "get pc before stepi loop at line_label_1"]
+ while { $pc < $ll2 } {
+ incr i
+ with_test_prefix $i {
+ set line_changed -1
+ gdb_test_multiple "stepi" "stepi until line_label_2" {
+ -re "main, set var to 99.*$gdb_prompt" {
+ set line_changed 0
+ }
+ -re "main, set var to 0.*$gdb_prompt " {
+ set line_changed 1
+ }
+ }
+ gdb_assert { $line_changed != -1 } \
+ "ensure we saw a valid line pattern"
+ set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
+ "get pc inside stepi loop from line_label_1"]
+ if { $ll2 == $pc } {
+ gdb_assert { $line_changed } \
+ "line must change at line_label_2"
+ } else {
+ gdb_assert { !$line_changed } \
+ "line should not change until line_label_2"
+ }
+ }
}
}
# Now single instruction step forward until GDB reports a new source
# line, at which point we should be at line_label_5.
-set i 0
-set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
- "get pc before stepi loop at line_label_2"]
-while { $pc < $ll5 } {
- incr i
- set line_changed -1
- gdb_test_multiple "stepi" "stepi until line_label_5, $i" {
- -re "main, set var to 0.*$gdb_prompt" {
- set line_changed 0
- }
- -re "main end.*$gdb_prompt " {
- set line_changed 1
- }
- }
- gdb_assert { $line_changed != -1 } \
- "ensure we saw a valid line pattern, $i"
+with_test_prefix "stepi until line_label_5" {
+ set i 0
set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
- "get pc inside stepi loop from line_label_2, $i"]
- if { $ll5 == $pc } {
- gdb_assert { $line_changed } \
- "line must change at line_label_5"
- } else {
- gdb_assert { !$line_changed } \
- "line should not change until line_label_5, $i"
+ "get pc before stepi loop at line_label_2"]
+ while { $pc < $ll5 } {
+ incr i
+ with_test_prefix $i {
+ set line_changed -1
+ gdb_test_multiple "stepi" "stepi until line_label_5" {
+ -re "main, set var to 0.*$gdb_prompt" {
+ set line_changed 0
+ }
+ -re "main end.*$gdb_prompt " {
+ set line_changed 1
+ }
+ }
+ gdb_assert { $line_changed != -1 } \
+ "ensure we saw a valid line pattern"
+ set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \
+ "get pc inside stepi loop from line_label_2"]
+ if { $ll5 == $pc } {
+ gdb_assert { $line_changed } \
+ "line must change at line_label_5"
+ } else {
+ gdb_assert { !$line_changed } \
+ "line should not change until line_label_5"
+ }
+ }
}
}
reply other threads:[~2021-09-24 10:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210924104104.GA1555@delia \
--to=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox