[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>
This commit is contained in:
Tom de Vries
2023-03-01 13:44:04 +01:00
parent d80081ef39
commit 2c29b1ed19

View File

@@ -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"