[Lldb-commits] [PATCH] D55356: Add a method to get the "base" file address of an object file

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 11 10:42:07 PST 2018

On 11/12/2018 19:17, Jim Ingham wrote:
> It the section isn't in the target's SectionLoadList, then GetLoadAddress should return LLDB_INVALID_ADDRESS.  I.e. this bit from Section::GetLoadBaseAddress:
>      load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress(
>          const_cast<Section *>(this)->shared_from_this());
> should return LLDB_INVALID_ADDRESS because the section isn't in the load list.
> Are we putting sections in the target's section load list before we've actually seen them loaded.  I'm pretty sure we shouldn't do that.
> Jim

The issue here is that the Address object in question is not backed by 
any section. It has a null section, and just an offset member.
In this case Address::GetLoadAddress just decides to return that address 
as a load address, which I imagine is correct in some situations, but in 
this case our intention was for this address to represent a file address 
(which would still need to be adjusted to account for where the module 
ended up being loaded).

More information about the lldb-commits mailing list