This is an archive of the discontinued LLVM Phabricator instance.

PECOFF: Implement GetBaseAddress
ClosedPublic

Authored by labath on Feb 11 2019, 5:24 AM.

Details

Summary

COFF files are modelled in lldb as having one big container section
spanning the entire module image, with the actual sections being
subsections of that. In this model, the base address is simply the
address of the first byte of that section.

This also removes the hack where ObjectFilePECOFF was using the
m_file_offset field to communicate this information. Using file offset
for this purpose is completely wrong, as that is supposed to indicate
where is this ObjectFile located in the file on disk. This field is only
meaningful for fat binaries, and should normally be 0.

Both PDB plugins have been updated to use GetBaseAddress instead of
GetFileOffset.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

LGTM. Now might not be the best time to commit it though because the LLDB build is broken on Windows.

This revision is now accepted and ready to land.Feb 15 2019, 10:07 AM

Thank you. It looks like windows is green now, so I'll go ahead and commit this.

labath closed this revision.Feb 18 2019, 4:01 AM

Committed in r354258.