Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Metzger <markus.t.metzger@intel.com>
To: palves@redhat.com
Cc: gdb-patches@sourceware.org
Subject: [PATCH] btrace, testsuite: fix spurious gdb.btrace/tsx.exp fails
Date: Fri, 18 Sep 2015 08:36:00 -0000	[thread overview]
Message-ID: <1442565363-13628-1-git-send-email-markus.t.metzger@intel.com> (raw)

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


             reply	other threads:[~2015-09-18  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  8:36 Markus Metzger [this message]
2015-09-18 11:44 ` Pedro Alves
2015-09-18 12:13   ` Metzger, Markus T
2015-09-18 12:56     ` Pedro Alves
2015-09-21  6:31       ` Metzger, Markus T

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=1442565363-13628-1-git-send-email-markus.t.metzger@intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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