[PATCH] D142654: [LiveDebugValues] Allow EntryValue with OP_deref expressions
Felipe de Azevedo Piovezan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 07:42:56 PST 2023
fdeazeve added a comment.
In D142654#4085122 <https://reviews.llvm.org/D142654#4085122>, @djtodoro wrote:
> Hello. I am wondering, have you checked how both ```GDB``` and ```LLDB``` act with this example?
I believe we don't have much to check in this example, as there are no callers for the function here.
However, the test `lldb/test/API/functionalities/param_entry_vals/basic_entry_values/` has a function with this exact behaviour (see func15).
It produces this dwarf for the callee:
0x0000065f: DW_TAG_subprogram
DW_AT_low_pc (0x00000000000001f8)
DW_AT_high_pc (0x0000000000000228)
DW_AT_frame_base (DW_OP_reg29 W29)
DW_AT_call_all_calls (true)
DW_AT_linkage_name ("_Z6func1537StructPassedViaPointerToTemporaryCopy")
DW_AT_name ("func15")
DW_AT_decl_file ("lldb/test/API/functionalities/param_entry_vals/basic_entry_values/main.cpp")
DW_AT_decl_line (157)
DW_AT_external (true)
0x00000678: DW_TAG_formal_parameter
DW_AT_location (0x000003ef:
[0x00000000000001f8, 0x0000000000000204): DW_OP_breg0 W0+0
[0x0000000000000204, 0x0000000000000228): DW_OP_entry_value(DW_OP_reg0 W0))
DW_AT_name ("S")
DW_AT_decl_file ("lldb/test/API/functionalities/param_entry_vals/basic_entry_values/main.cpp")
DW_AT_decl_line (157)
DW_AT_type (0x00000749 "StructPassedViaPointerToTemporaryCopy")
And then, on the caller's side (main):
0x0000093d: DW_TAG_call_site
DW_AT_call_origin (0x0000065f)
DW_AT_call_return_pc (0x00000000000002dc)
0x0000094a: DW_TAG_call_site_parameter
DW_AT_location (DW_OP_reg0 W0)
DW_AT_call_value (DW_OP_breg31 WSP+8)
LLDB is able -- in fact this is what the test is testing -- to recover the parameter with those two pieces of information.
I have not checked whether GDB has support for this dwarf OP.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142654/new/
https://reviews.llvm.org/D142654
More information about the llvm-commits
mailing list