mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibCoreDump: Make symbolication work when .text isn't the first segment
This can happen with binaries built with Clang or with a custom linker script.
This commit is contained in:
parent
99d46caa28
commit
c9118b84b7
3 changed files with 21 additions and 3 deletions
|
@ -137,6 +137,19 @@ const JsonObject Reader::process_info() const
|
|||
// FIXME: Maybe just cache this on the Reader instance after first access.
|
||||
}
|
||||
|
||||
ELF::Core::MemoryRegionInfo const* Reader::first_region_for_object(StringView object_name) const
|
||||
{
|
||||
ELF::Core::MemoryRegionInfo const* ret = nullptr;
|
||||
for_each_memory_region_info([&ret, &object_name](auto& region_info) {
|
||||
if (region_info.object_name() == object_name) {
|
||||
ret = ®ion_info;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
const ELF::Core::MemoryRegionInfo* Reader::region_containing(FlatPtr address) const
|
||||
{
|
||||
const ELF::Core::MemoryRegionInfo* ret = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue