mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
UserspaceEmulator: Make symbolication work when .text isn't the first
... segment This happens with binaries build with Clang or with a custom linker script. If this is the case, offsets should be calculated not from the base address of `.text`, but from the first section loaded for the library. This commit moves all UserspaceEmulator symbolication into a common helper function and fixes a FIXME.
This commit is contained in:
parent
980f314a03
commit
c1d6637dc7
Notes:
sideshowbarker
2024-07-18 07:16:26 +09:00
Author: https://github.com/BertalanD
Commit: c1d6637dc7
Pull-request: https://github.com/SerenityOS/serenity/pull/8718
Issue: https://github.com/SerenityOS/serenity/issues/363
Reviewed-by: https://github.com/gunnarbeutner ✅
Reviewed-by: https://github.com/nico
4 changed files with 77 additions and 55 deletions
|
@ -71,6 +71,16 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
template<typename Type, typename Callback>
|
||||
void for_each_region_of_type(Callback callback)
|
||||
{
|
||||
return for_each_region([callback](auto& region) {
|
||||
if (!is<Type>(region))
|
||||
return IterationDecision::Continue;
|
||||
return callback(static_cast<Type&>(region));
|
||||
});
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
void for_regions_in(X86::LogicalAddress address, size_t size, Callback callback)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue