1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

LibJS/JIT: Produce & register an ELF image for GDB JIT Interface

Using the code that it has just produced, the JIT::Compiler can build an
ELF image so that we can attach meaningful symbols to JITted code, and
thus enable GDB to display more information about the code that we're
running.
This commit is contained in:
Jesús (gsus) Lapastora 2023-11-11 23:35:24 +01:00 committed by Andrew Kaster
parent 149e382735
commit f0b984567a
3 changed files with 20 additions and 3 deletions

View file

@ -6,6 +6,7 @@
#pragma once
#include <AK/FixedArray.h>
#include <AK/Noncopyable.h>
#include <AK/Types.h>
#include <LibJS/Bytecode/Instruction.h>
@ -28,7 +29,7 @@ class NativeExecutable {
AK_MAKE_NONMOVABLE(NativeExecutable);
public:
NativeExecutable(void* code, size_t size, Vector<BytecodeMapping>);
NativeExecutable(void* code, size_t size, Vector<BytecodeMapping>, Optional<FixedArray<u8>> gdb_object = {});
~NativeExecutable();
void run(VM&, size_t entry_point) const;
@ -44,6 +45,7 @@ private:
Vector<BytecodeMapping> m_mapping;
Vector<FlatPtr> m_block_entry_points;
mutable OwnPtr<Bytecode::InstructionStreamIterator> m_instruction_stream_iterator;
Optional<FixedArray<u8>> m_gdb_object;
};
}