mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibDebug: Remove i686 support
This commit is contained in:
parent
a4c87fac56
commit
1d26b46884
4 changed files with 6 additions and 33 deletions
|
@ -167,9 +167,7 @@ NonnullOwnPtrVector<DebugInfo::VariableInfo> DebugInfo::get_variables_in_current
|
||||||
// TODO: We can store the scopes in a better data structure
|
// TODO: We can store the scopes in a better data structure
|
||||||
for (auto const& scope : m_scopes) {
|
for (auto const& scope : m_scopes) {
|
||||||
FlatPtr ip;
|
FlatPtr ip;
|
||||||
#if ARCH(I386)
|
#if ARCH(X86_64)
|
||||||
ip = regs.eip;
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
ip = regs.rip;
|
ip = regs.rip;
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
|
|
|
@ -343,12 +343,8 @@ FlatPtr DebugSession::single_step()
|
||||||
// After the debuggee has stopped, we clear the TRAP flag.
|
// After the debuggee has stopped, we clear the TRAP flag.
|
||||||
|
|
||||||
auto regs = get_registers();
|
auto regs = get_registers();
|
||||||
#if ARCH(I386) || ARCH(X86_64)
|
#if ARCH(X86_64)
|
||||||
constexpr u32 TRAP_FLAG = 0x100;
|
constexpr u32 TRAP_FLAG = 0x100;
|
||||||
#endif
|
|
||||||
#if ARCH(I386)
|
|
||||||
regs.eflags |= TRAP_FLAG;
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
regs.rflags |= TRAP_FLAG;
|
regs.rflags |= TRAP_FLAG;
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
|
@ -365,9 +361,7 @@ FlatPtr DebugSession::single_step()
|
||||||
}
|
}
|
||||||
|
|
||||||
regs = get_registers();
|
regs = get_registers();
|
||||||
#if ARCH(I386)
|
#if ARCH(X86_64)
|
||||||
regs.eflags &= ~(TRAP_FLAG);
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
regs.rflags &= ~(TRAP_FLAG);
|
regs.rflags &= ~(TRAP_FLAG);
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
|
|
|
@ -184,9 +184,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
|
||||||
|
|
||||||
auto regs = get_registers();
|
auto regs = get_registers();
|
||||||
|
|
||||||
#if ARCH(I386)
|
#if ARCH(X86_64)
|
||||||
FlatPtr current_instruction = regs.eip;
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
FlatPtr current_instruction = regs.rip;
|
FlatPtr current_instruction = regs.rip;
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
FlatPtr current_instruction;
|
FlatPtr current_instruction;
|
||||||
|
@ -210,9 +208,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
|
||||||
auto required_ebp = watchpoint.value().ebp;
|
auto required_ebp = watchpoint.value().ebp;
|
||||||
auto found_ebp = false;
|
auto found_ebp = false;
|
||||||
|
|
||||||
#if ARCH(I386)
|
#if ARCH(X86_64)
|
||||||
FlatPtr current_ebp = regs.ebp;
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
FlatPtr current_ebp = regs.rbp;
|
FlatPtr current_ebp = regs.rbp;
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
FlatPtr current_ebp;
|
FlatPtr current_ebp;
|
||||||
|
@ -261,9 +257,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
|
||||||
// 2. We restore the original first byte of the instruction,
|
// 2. We restore the original first byte of the instruction,
|
||||||
// because it was patched with INT3.
|
// because it was patched with INT3.
|
||||||
auto breakpoint_addr = bit_cast<FlatPtr>(current_breakpoint.value().address);
|
auto breakpoint_addr = bit_cast<FlatPtr>(current_breakpoint.value().address);
|
||||||
#if ARCH(I386)
|
#if ARCH(X86_64)
|
||||||
regs.eip = breakpoint_addr;
|
|
||||||
#elif ARCH(X86_64)
|
|
||||||
regs.rip = breakpoint_addr;
|
regs.rip = breakpoint_addr;
|
||||||
#elif ARCH(AARCH64)
|
#elif ARCH(AARCH64)
|
||||||
(void)breakpoint_addr;
|
(void)breakpoint_addr;
|
||||||
|
|
|
@ -21,19 +21,6 @@ Value evaluate(ReadonlyBytes bytes, [[maybe_unused]] PtraceRegisters const& regs
|
||||||
stream >> opcode;
|
stream >> opcode;
|
||||||
|
|
||||||
switch (static_cast<Operations>(opcode)) {
|
switch (static_cast<Operations>(opcode)) {
|
||||||
#if ARCH(I386)
|
|
||||||
case Operations::RegEbp: {
|
|
||||||
ssize_t offset = 0;
|
|
||||||
stream.read_LEB128_signed(offset);
|
|
||||||
return Value { Type::UnsignedInteger, { regs.ebp + offset } };
|
|
||||||
}
|
|
||||||
|
|
||||||
case Operations::FbReg: {
|
|
||||||
ssize_t offset = 0;
|
|
||||||
stream.read_LEB128_signed(offset);
|
|
||||||
return Value { Type::UnsignedInteger, { regs.ebp + 2 * sizeof(size_t) + offset } };
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dbgln("DWARF expr addr: {:p}", bytes.data());
|
dbgln("DWARF expr addr: {:p}", bytes.data());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue