From def86538a46f7ce6fbb215cfb184e23015b5d538 Mon Sep 17 00:00:00 2001 From: Guinevere Larsen Date: Wed, 25 Oct 2023 10:44:19 +0200 Subject: [PATCH] gdb/testsuite: add a clang XFAIL to gdb.python/py-watchpoint.exp Clang doesn't use CFA information for variable locations. This makes it so software breakpoints get a false hit when rbp gets popped, causing a FAIL in gdb.python/py-watchpoint.exp. Since this is nothing wrong with GDB itself, add an xfail to reduce noise. Approved-By: Tom Tromey --- gdb/testsuite/gdb.python/py-watchpoint.exp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.python/py-watchpoint.exp b/gdb/testsuite/gdb.python/py-watchpoint.exp index 9a6ef447572..5ff61285979 100644 --- a/gdb/testsuite/gdb.python/py-watchpoint.exp +++ b/gdb/testsuite/gdb.python/py-watchpoint.exp @@ -42,5 +42,20 @@ gdb_test "source $pyfile" ".*Python script imported.*" \ "import python scripts" gdb_test "python print(len(gdb.breakpoints()))" "2" "check modified BP count" gdb_test "continue" ".*" "run until program stops" -gdb_test "python print(bpt.n)" "5" "check watchpoint hits" +# Clang doesn't use CFA location information for variables (despite generating +# them), meaning when the instruction "pop rbp" happens, we get a false hit +# on the watchpoint. for more details, see: +# https://github.com/llvm/llvm-project/issues/64390 +gdb_test_multiple "python print(bpt.n)" "check watchpoint hits" { + -re -wrap "5" { + pass $gdb_test_name + } + -re -wrap "6" { + if {[test_compiler_info "clang-*"]} { + xfail "$gdb_test_name (clang issue 64390)" + } else { + fail $gdb_test_name + } + } +} gdb_test "python print(len(gdb.breakpoints()))" "1" "check BP count" -- 2.30.2