diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index 57f1ad4830..25d976d417 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -167,9 +167,7 @@ NonnullOwnPtrVector DebugInfo::get_variables_in_current // TODO: We can store the scopes in a better data structure for (auto const& scope : m_scopes) { FlatPtr ip; -#if ARCH(I386) - ip = regs.eip; -#elif ARCH(X86_64) +#if ARCH(X86_64) ip = regs.rip; #elif ARCH(AARCH64) TODO_AARCH64(); diff --git a/Userland/Libraries/LibDebug/DebugSession.cpp b/Userland/Libraries/LibDebug/DebugSession.cpp index c195673b6b..fb1bb41704 100644 --- a/Userland/Libraries/LibDebug/DebugSession.cpp +++ b/Userland/Libraries/LibDebug/DebugSession.cpp @@ -343,12 +343,8 @@ FlatPtr DebugSession::single_step() // After the debuggee has stopped, we clear the TRAP flag. auto regs = get_registers(); -#if ARCH(I386) || ARCH(X86_64) +#if ARCH(X86_64) constexpr u32 TRAP_FLAG = 0x100; -#endif -#if ARCH(I386) - regs.eflags |= TRAP_FLAG; -#elif ARCH(X86_64) regs.rflags |= TRAP_FLAG; #elif ARCH(AARCH64) TODO_AARCH64(); @@ -365,9 +361,7 @@ FlatPtr DebugSession::single_step() } regs = get_registers(); -#if ARCH(I386) - regs.eflags &= ~(TRAP_FLAG); -#elif ARCH(X86_64) +#if ARCH(X86_64) regs.rflags &= ~(TRAP_FLAG); #elif ARCH(AARCH64) TODO_AARCH64(); diff --git a/Userland/Libraries/LibDebug/DebugSession.h b/Userland/Libraries/LibDebug/DebugSession.h index 87fea886bc..ed6e3750f8 100644 --- a/Userland/Libraries/LibDebug/DebugSession.h +++ b/Userland/Libraries/LibDebug/DebugSession.h @@ -184,9 +184,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac auto regs = get_registers(); -#if ARCH(I386) - FlatPtr current_instruction = regs.eip; -#elif ARCH(X86_64) +#if ARCH(X86_64) FlatPtr current_instruction = regs.rip; #elif ARCH(AARCH64) FlatPtr current_instruction; @@ -210,9 +208,7 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac auto required_ebp = watchpoint.value().ebp; auto found_ebp = false; -#if ARCH(I386) - FlatPtr current_ebp = regs.ebp; -#elif ARCH(X86_64) +#if ARCH(X86_64) FlatPtr current_ebp = regs.rbp; #elif ARCH(AARCH64) 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, // because it was patched with INT3. auto breakpoint_addr = bit_cast(current_breakpoint.value().address); -#if ARCH(I386) - regs.eip = breakpoint_addr; -#elif ARCH(X86_64) +#if ARCH(X86_64) regs.rip = breakpoint_addr; #elif ARCH(AARCH64) (void)breakpoint_addr; diff --git a/Userland/Libraries/LibDebug/Dwarf/Expression.cpp b/Userland/Libraries/LibDebug/Dwarf/Expression.cpp index 08dda504e5..11acb72b53 100644 --- a/Userland/Libraries/LibDebug/Dwarf/Expression.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/Expression.cpp @@ -21,19 +21,6 @@ Value evaluate(ReadonlyBytes bytes, [[maybe_unused]] PtraceRegisters const& regs stream >> opcode; switch (static_cast(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: dbgln("DWARF expr addr: {:p}", bytes.data());