1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 22:54:57 +00:00
serenity/Userland/Libraries/LibDebug
Itamar c78838c2d2 LibDebug: Use the first memory segment of a library as the ELF's base
When parsing the libraries of the debugee process, we previously
assumed that the region that's called `<library name>: .text` was also
the base of the ELF file.

However, since we started linking with `-z separate-code`, this is no
longer the case - our executables have a read-only segment before the
.text segment, and that segment is actually at the base of the ELF.

This broke inserting breakpoints with the debugger since they were
inserted at a wrong offset.

To fix that, we now use the address of the first segment in the memory
map for the ELF's base address (The memory map is sorted by address).
2021-09-10 13:57:34 +00:00
..
Dwarf LibDebug: Store 64-bit numbers in AttributeValue 2021-08-08 10:55:36 +02:00
CMakeLists.txt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
DebugInfo.cpp LibDebug: Use HashMap::ensure() in DebugInfo::prepare_lines() 2021-09-04 20:30:56 +02:00
DebugInfo.h LibDebug+Everywhere: Make DebugInfo not own the ELF image 2021-08-06 01:14:03 +02:00
DebugSession.cpp LibDebug: Use the first memory segment of a library as the ELF's base 2021-09-10 13:57:34 +00:00
DebugSession.h LibDebug+Everywhere: Make DebugInfo not own the ELF image 2021-08-06 01:14:03 +02:00
StackFrameUtils.cpp LibDebug: Convert LibDebug to east-const style 2021-06-19 14:51:18 +02:00
StackFrameUtils.h LibDebug: Convert LibDebug to east-const style 2021-06-19 14:51:18 +02:00