This is an archive of the discontinued LLVM Phabricator instance.

Support loading files even when incorrect file name specified by the linker
ClosedPublic

Authored by tberghammer on Jul 11 2016, 7:20 AM.

Details

Summary

Support loading files even when incorrect file name specified by the linker

"Incorrect" file name seen on Android whene the main executable is
called "app_process32" (or 64) but the linker specifies the package
name (e.g. com.android.calculator2). Additionally it can be present
in case of some linker bugs.

This CL adds logic to try to fetch the correct file name from the proc
file system based on the base address sepcified by the linker in case
we are failed to load the module by name.

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer retitled this revision from to Support loading files even when incorrect file name specified by the linker.
tberghammer updated this object.
tberghammer added reviewers: labath, clayborg.
tberghammer added a subscriber: lldb-commits.
clayborg requested changes to this revision.Jul 11 2016, 10:06 AM
clayborg edited edge metadata.

Looks good. Please pipe the GetName through the SBMemoryRegionInfo by modifying the SBMemoryRegionInfo.h, SBMemoryRegionInfo.cpp, and SBMemoryRegionInfo.i files. The signature should be:

const char *
SBMemoryRegionInfo::GetName();

Since m_name is a ConstString, you can just return the m_name.GetCString() since the string is owned by the string pool.

This revision now requires changes to proceed.Jul 11 2016, 10:06 AM
tberghammer edited edge metadata.

Add SBMemoryRegionInfo::GetName

This revision was automatically updated to reflect the committed changes.