1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Debugger: Add DebugSession

The DebugSession class wraps the usage of Ptrace.
It is intended to be used by cli & gui debugger programs.

Also, call objdump for disassemly
This commit is contained in:
Itamar 2020-04-10 17:35:49 +03:00 committed by Andreas Kling
parent 50fd2cabff
commit 3e9a7175d1
10 changed files with 473 additions and 166 deletions

View file

@ -4935,6 +4935,7 @@ bool Process::has_tracee_thread(int tracer_pid) const
KResultOr<u32> Process::peek_user_data(u32* address)
{
if (!MM.validate_user_read(*this, VirtualAddress(address), sizeof(u32))) {
dbg() << "Invalid address for peek_user_data: " << address;
return KResult(-EFAULT);
}
uint32_t result;
@ -4951,8 +4952,9 @@ KResultOr<u32> Process::peek_user_data(u32* address)
KResult Process::poke_user_data(u32* address, u32 data)
{
// We validate for read (rather than write) because PT_POKE can write to readonly pages.
// So we wffectively only care that the poke operation only writes to user pages
// So we effectively only care that the poke operation is trying to write to user pages.
if (!MM.validate_user_read(*this, VirtualAddress(address), sizeof(u32))) {
dbg() << "Invalid address for poke_user_data: " << address;
return KResult(-EFAULT);
}
ProcessPagingScope scope(*this);