This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] btrace, testsuite: fix spurious gdb.btrace/tsx.exp fails
- From: Markus Metzger <markus dot t dot metzger at intel dot com>
- To: palves at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 18 Sep 2015 10:36:03 +0200
- Subject: [PATCH] btrace, testsuite: fix spurious gdb.btrace/tsx.exp fails
- Authentication-results: sourceware.org; auth=none
If the atomic section in x86-tsx.S is aborted, the tsx.exp test will fail
even if the traced output is actually correct.
Consider abort scenarios in the test.
2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
testsuite/
* gdb.btrace/tsx.exp: Consider multiple correct outputs in the record
instruction-history test.
---
gdb/testsuite/gdb.btrace/tsx.exp | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/gdb.btrace/tsx.exp b/gdb/testsuite/gdb.btrace/tsx.exp
index 525d4d2..cc493a1 100644
--- a/gdb/testsuite/gdb.btrace/tsx.exp
+++ b/gdb/testsuite/gdb.btrace/tsx.exp
@@ -32,10 +32,34 @@ gdb_test_no_output "record btrace pt"
gdb_test "next"
# look at the instruction trace
-gdb_test "record instruction-history" [multi_line \
- ".*" \
- "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
- "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
- "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txend\[^\\\r\\\n\]*" \
- ".*" \
- ]
+set begin_to_end [multi_line \
+ ".*" \
+ "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txend\[^\\\r\\\n\]*" \
+ ]
+set abort_1 [multi_line \
+ ".*" \
+ "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
+ ]
+set abort_2 [multi_line \
+ ".*" \
+ "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
+ "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
+ ]
+
+gdb_test_multiple "record instruction-history" "speculation indication" {
+ -re "$abort_1.*$gdb_prompt $" {
+ pass "speculation indication: abort"
+ }
+ -re "$abort_2.*$gdb_prompt $" {
+ pass "speculation indication: abort"
+ }
+ -re "$begin_to_end.*$gdb_prompt $" {
+ pass "speculation indication: begin..end"
+ }
+}
--
1.8.3.1