[Lldb-commits] [lldb] [lldb] Use the first address range as the function address (PR #122440)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 13 04:09:01 PST 2025
================
@@ -428,7 +428,7 @@ class Function : public UserID, public SymbolContextScope {
/// The section offset based address for this function.
Function(CompileUnit *comp_unit, lldb::user_id_t func_uid,
lldb::user_id_t func_type_uid, const Mangled &mangled,
- Type *func_type, AddressRanges ranges);
+ Type *func_type, Address address, AddressRanges ranges);
----------------
labath wrote:
Yes, that was my reasoning as well (my first version of the patch actually did just take the first range in the list as the function address, but it seemed too magical).
I'll also add that the DWARF *standard* does support other ways of specifying the entry point -- via an explicit `DW_AT_entry_pc` attribute. It's just that lldb doesn't use that attribute in this way, and also clang (-fbasic-block-sections is clang-specific, so I don't know how to test on gcc) does not emit it. If at some point we wanted/needed to support that attribute, we could pass it through this argument (that's what the long comment in the DWARF code is trying to say).
https://github.com/llvm/llvm-project/pull/122440
More information about the lldb-commits
mailing list