amd64_frame_base_address
};
+/* Implement core of the stack_frame_destroyed_p gdbarch method. */
+
+static int
+amd64_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ gdb_byte insn;
+
+ if (target_read_memory (pc, &insn, 1))
+ return 0; /* Can't read memory at pc. */
+
+ if (insn != 0xc3) /* 'ret' instruction. */
+ return 0;
+
+ return 1;
+}
+
/* Normal frames, but in a function epilogue. */
/* Implement the stack_frame_destroyed_p gdbarch method.
static int
amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- gdb_byte insn;
+ struct compunit_symtab *cust = find_pc_compunit_symtab (pc);
- if (target_read_memory (pc, &insn, 1))
- return 0; /* Can't read memory at pc. */
+ if (cust != nullptr && cust->producer () != nullptr
+ && producer_is_llvm (cust->producer ()))
+ return amd64_stack_frame_destroyed_p_1 (gdbarch, pc);
- if (insn != 0xc3) /* 'ret' instruction. */
- return 0;
-
- return 1;
+ return 0;
}
static int
}
/* Check whether we're in an epilogue. */
- return amd64_stack_frame_destroyed_p (gdbarch, pc);
+ return amd64_stack_frame_destroyed_p_1 (gdbarch, pc);
}
static int
set_gdbarch_gen_return_address (gdbarch, amd64_gen_return_address);
+ set_gdbarch_stack_frame_destroyed_p (gdbarch, amd64_stack_frame_destroyed_p);
+
/* SystemTap variables and functions. */
set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);
set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes);
"import python scripts"
gdb_test "python print(len(gdb.breakpoints()))" "2" "check modified BP count"
gdb_test "continue" ".*" "run until program stops"
-# 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(bpt.n)" "5" "check watchpoint hits"
gdb_test "python print(len(gdb.breakpoints()))" "1" "check BP count"