aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-01 13:44:04 +0100
committerTom de Vries <tdevries@suse.de>2023-03-01 13:44:04 +0100
commit2c29b1ed19711fa2a16558015e5a6b46a09aefeb (patch)
tree75b420dc1d5e934a37afba1ceb67cdabf5f20aee
parentd80081ef39c729b0f5f548c9567be2d80dcc2fd0 (diff)
downloadgdb-2c29b1ed19711fa2a16558015e5a6b46a09aefeb.zip
gdb-2c29b1ed19711fa2a16558015e5a6b46a09aefeb.tar.gz
gdb-2c29b1ed19711fa2a16558015e5a6b46a09aefeb.tar.bz2
[gdb/testsuite] Add another xfail case in gdb.python/py-record-btrace.exp
I ran into: ... (gdb) PASS: gdb.python/py-record-btrace.exp: function call: \ python print(c.prev) python print(c == c.next.prev)^M Traceback (most recent call last):^M File "<string>", line 1, in <module>^M AttributeError: 'NoneType' object has no attribute 'prev'^M Error while executing Python code.^M (gdb) FAIL: gdb.python/py-record-btrace.exp: function call: \ python print(c == c.next.prev) ... due to having only 4 insn instead of 100: ... python print(len(insn))^M 4^M ... This could be caused by the same hw bug as we already have an xfail for, so expand the xfail matching. Tested on x86_64-linux. PR testsuite/30185 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30185 Approved-By: Markus T. Metzger <markus.t.metzger@intel.com>
-rw-r--r--gdb/testsuite/gdb.python/py-record-btrace.exp20
1 files changed, 19 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp
index 703db0c..bd397d3 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace.exp
@@ -101,6 +101,25 @@ with_test_prefix "prepare record" {
return
}
+ # Also handle the case that we're running into the hw bug without
+ # triggering a decode error.
+ gdb_test_multiple "python print(len(insn))" "" {
+ -re -wrap "100" {
+ pass $gdb_test_name
+ }
+ -re -wrap "" {
+ if { $have_xfail } {
+ xfail $gdb_test_name
+ set got_xfail 1
+ } else {
+ fail $gdb_test_name
+ }
+ }
+ }
+ if { $got_xfail } {
+ return
+ }
+
gdb_test_no_output "python call = r.function_call_history"
gdb_test_no_output "python i = insn\[0\]"
gdb_test_no_output "python c = call\[0\]"
@@ -138,7 +157,6 @@ with_test_prefix "function call" {
}
with_test_prefix "list" {
- gdb_test "python print(len(insn))" "100"
gdb_test "python print(len(insn\[23:65\]))" "42"
gdb_test "python print(insn\[17:\]\[2\].number)" "20"
gdb_test "python print(i in insn)" "True"