summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDebug
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibDebug')
-rw-r--r--Userland/Libraries/LibDebug/DebugInfo.cpp4
-rw-r--r--Userland/Libraries/LibDebug/DebugSession.cpp8
-rw-r--r--Userland/Libraries/LibDebug/DebugSession.h12
3 files changed, 18 insertions, 6 deletions
diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp
index 6e6af3858a..19fad91e4f 100644
--- a/Userland/Libraries/LibDebug/DebugInfo.cpp
+++ b/Userland/Libraries/LibDebug/DebugInfo.cpp
@@ -169,8 +169,10 @@ NonnullOwnPtrVector<DebugInfo::VariableInfo> DebugInfo::get_variables_in_current
FlatPtr ip;
#if ARCH(I386)
ip = regs.eip;
-#else
+#elif ARCH(X86_64)
ip = regs.rip;
+#else
+# error Unknown architecture
#endif
if (ip - m_base_address < scope.address_low || ip - m_base_address >= scope.address_high)
continue;
diff --git a/Userland/Libraries/LibDebug/DebugSession.cpp b/Userland/Libraries/LibDebug/DebugSession.cpp
index 49940fe9e5..fdf01c2e51 100644
--- a/Userland/Libraries/LibDebug/DebugSession.cpp
+++ b/Userland/Libraries/LibDebug/DebugSession.cpp
@@ -346,8 +346,10 @@ FlatPtr DebugSession::single_step()
constexpr u32 TRAP_FLAG = 0x100;
#if ARCH(I386)
regs.eflags |= TRAP_FLAG;
-#else
+#elif ARCH(X86_64)
regs.rflags |= TRAP_FLAG;
+#else
+# error Unknown architecture
#endif
set_registers(regs);
@@ -361,8 +363,10 @@ FlatPtr DebugSession::single_step()
regs = get_registers();
#if ARCH(I386)
regs.eflags &= ~(TRAP_FLAG);
-#else
+#elif ARCH(X86_64)
regs.rflags &= ~(TRAP_FLAG);
+#else
+# error Unknown architecture
#endif
set_registers(regs);
return regs.ip();
diff --git a/Userland/Libraries/LibDebug/DebugSession.h b/Userland/Libraries/LibDebug/DebugSession.h
index dde23a1a16..3a9f23b0e8 100644
--- a/Userland/Libraries/LibDebug/DebugSession.h
+++ b/Userland/Libraries/LibDebug/DebugSession.h
@@ -186,8 +186,10 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
#if ARCH(I386)
FlatPtr current_instruction = regs.eip;
-#else
+#elif ARCH(X86_64)
FlatPtr current_instruction = regs.rip;
+#else
+# error Unknown architecture
#endif
auto debug_status = peek_debug(DEBUG_STATUS_REGISTER);
@@ -207,8 +209,10 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
#if ARCH(I386)
FlatPtr current_ebp = regs.ebp;
-#else
+#elif ARCH(X86_64)
FlatPtr current_ebp = regs.rbp;
+#else
+# error Unknown architecture
#endif
do {
@@ -253,8 +257,10 @@ void DebugSession::run(DesiredInitialDebugeeState initial_debugee_state, Callbac
auto breakpoint_addr = bit_cast<FlatPtr>(current_breakpoint.value().address);
#if ARCH(I386)
regs.eip = breakpoint_addr;
-#else
+#elif ARCH(X86_64)
regs.rip = breakpoint_addr;
+#else
+# error Unknown architecture
#endif
set_registers(regs);
disable_breakpoint(current_breakpoint.value().address);