mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
UserspaceEmulator: Support dynamically loaded programs
When loading dynamic objects, the emulator loads the interpreter, generates an auxiliary vector and starts executing the loader. Additionally, this commits also makes the MallocTracer and backtrace symbolication work for dynamically loaded programs.
This commit is contained in:
parent
28cda567c1
commit
72ca45e300
9 changed files with 247 additions and 64 deletions
|
@ -229,6 +229,13 @@ void SoftCPU::push_string(const StringView& string)
|
|||
m_emulator.mmu().write8({ 0x20, esp().value() + string.length() }, shadow_wrap_as_initialized((u8)'\0'));
|
||||
}
|
||||
|
||||
void SoftCPU::push_buffer(const u8* data, size_t size)
|
||||
{
|
||||
set_esp({ esp().value() - size, esp().shadow() });
|
||||
warn_if_uninitialized(esp(), "push_buffer");
|
||||
m_emulator.mmu().copy_to_vm(esp().value(), data, size);
|
||||
}
|
||||
|
||||
void SoftCPU::push32(ValueWithShadow<u32> value)
|
||||
{
|
||||
set_esp({ esp().value() - sizeof(u32), esp().shadow() });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue