1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

Profiler: Fix disassembling objects with a non-zero .text vaddr

Previously, we assumed that the `.text` segment was loaded at vaddr 0 in
shared object, which is not the case with `-z separate-code` enabled.
Because we didn't do the right calculations to translate an address from
a performance event into its value within the ELF file, Profiler would
try to disassemble out-of-bounds memory locations, leading to a crash.

This commit also changes `LibraryMetadata` to apply to a loaded library
as a whole, not just to one of its segments (like .text or .data). This
lets us simplify the interface, as we no longer have to worry about
`text_base`.

Fixes #10628
This commit is contained in:
Daniel Bertalan 2021-10-25 11:20:30 +02:00 committed by Andreas Kling
parent 15a14d3d21
commit ac1cac286b
2 changed files with 32 additions and 27 deletions

View file

@ -28,7 +28,6 @@ public:
FlatPtr base;
size_t size;
String name;
FlatPtr text_base;
MappedObject* object { nullptr };
String symbolicate(FlatPtr, u32* offset) const;