1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:57:34 +00:00

Everywhere: Make the codebase more architecture aware

This commit is contained in:
Undefine 2022-07-22 20:48:24 +02:00 committed by Brian Gianforcaro
parent 6c4b5775e1
commit 97cc33ca47
22 changed files with 108 additions and 36 deletions

View file

@ -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);