mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:07:35 +00:00
LibJIT: Integrate GDB JIT Interface with ELF builders
Provide a function to create an ELF image in a format GDB expects. Outside of ELF platforms this image doesn't make much sense, and in MacOS a Mach-O memory image is required: see https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/diagnostics/gdb-jit.cc#1802 Since GDB requires active runtime addresses for the code, copying the generated code into the image will not help. Instead, `build_gdb_image` writes the runtime addresses of the code into a NOBITS `.text` section.
This commit is contained in:
parent
48a9d0ede8
commit
149e382735
4 changed files with 122 additions and 0 deletions
|
@ -2,6 +2,14 @@ set(SOURCES
|
|||
Assembler.cpp
|
||||
GDB.cpp
|
||||
)
|
||||
if(NOT APPLE AND NOT WIN32 AND NOT EMSCRIPTEN)
|
||||
list(APPEND SOURCES GDBElf.cpp)
|
||||
else()
|
||||
list(APPEND SOURCES GDBUnsupported.cpp)
|
||||
endif()
|
||||
|
||||
serenity_lib(LibJIT jit)
|
||||
if(NOT APPLE AND NOT WIN32 AND NOT EMSCRIPTEN)
|
||||
target_link_libraries(LibJIT PRIVATE LibELF)
|
||||
endif()
|
||||
target_link_libraries(LibJIT PRIVATE LibCore)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue