[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:18:08 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:

Personally, I don't think that adds anything. "function base address" isn't an established concept. "function address" is (at least if you're coming from C/C++), and that is exactly what this argument should contain. It's true that this address is also used as a base for computing the addresses of blocks and variables, but I think that's a secondary function (technically, the two don't even have to be the same, but I don't think separating the two would help). There is also a comment on the getter function (line 455) which should help resolving any ambiguity.

https://github.com/llvm/llvm-project/pull/122440


More information about the lldb-commits mailing list