This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] btrace, testsuite: fix spurious gdb.btrace/tsx.exp fails


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=77ba2a67960d05991a3e3641049cac649ca04c96

commit 77ba2a67960d05991a3e3641049cac649ca04c96
Author: Markus Metzger <markus.t.metzger@intel.com>
Date:   Mon Aug 24 11:37:53 2015 +0200

    btrace, testsuite: fix spurious gdb.btrace/tsx.exp fails
    
    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.
    
    testsuite/
    	* gdb.btrace/tsx.exp: Consider multiple correct outputs in the record
    	instruction-history test.

Diff:
---
 gdb/testsuite/ChangeLog          |  5 +++++
 gdb/testsuite/gdb.btrace/tsx.exp | 39 ++++++++++++++++++++++++++++++++-------
 2 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 344e633..d530c25 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-30  Markus Metzger  <markus.t.metzger@intel.com>
+
+	* gdb.btrace/tsx.exp: Consider multiple correct outputs in the record
+	instruction-history test.
+
 2015-09-28  Doug Evans  <dje@google.com>
 
 	* gdb.base/gcore.c (array_func): Add reference to static_array.
diff --git a/gdb/testsuite/gdb.btrace/tsx.exp b/gdb/testsuite/gdb.btrace/tsx.exp
index 525d4d2..284f89c 100644
--- a/gdb/testsuite/gdb.btrace/tsx.exp
+++ b/gdb/testsuite/gdb.btrace/tsx.exp
@@ -32,10 +32,35 @@ 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\]*" \
+    ]
+
+set test "speculation indication"
+gdb_test_multiple "record instruction-history" $test {
+    -re "$abort_1.*$gdb_prompt $" {
+        pass $test
+    }
+    -re "$abort_2.*$gdb_prompt $" {
+        pass $test
+    }
+    -re  "$begin_to_end.*$gdb_prompt $" {
+        pass $test
+    }
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]