aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Smith <alex@alex-smith.me.uk>2012-07-12 15:59:50 +0100
committerAlex Smith <alex@alex-smith.me.uk>2012-07-12 15:59:50 +0100
commit7dc738b0fb075b6eedc27e1efddb5661c085c7d8 (patch)
tree91ff2f440c55062194065084f814cb12d9cf72ed
parent8c51cca27ef0f61a7b0b99c2179ca77e0b5c25a2 (diff)
Fixed ordering of registers in arch_debug_gdb_get_registers.hrev44321
Current code was sending EAX, EBX, ECX, EDX..., GDB (all versions as far as I can tell) expects EAX, ECX, EDX, EBX... Also added missing FS and GS.
-rw-r--r--src/system/kernel/arch/x86/arch_debug.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp
index d3c6b8b1e9..1cd4dad7db 100644
--- a/src/system/kernel/arch/x86/arch_debug.cpp
+++ b/src/system/kernel/arch/x86/arch_debug.cpp
@@ -1188,21 +1188,22 @@ arch_debug_gdb_get_registers(char* buffer, size_t bufferSize)
// For x86 the register order is:
//
- // eax, ebx, ecx, edx,
+ // eax, ecx, edx, ebx,
// esp, ebp, esi, edi,
// eip, eflags,
- // cs, ss, ds, es
+ // cs, ss, ds, es, fs, gs
//
// Note that even though the segment descriptors are actually 16 bits wide,
// gdb requires them as 32 bit integers. Note also that for some reason
// gdb wants the register dump in *big endian* format.
- static const int32 kRegisterCount = 14;
+ static const int32 kRegisterCount = 16;
uint32 registers[kRegisterCount] = {
- frame->eax, frame->ebx, frame->ecx, frame->edx,
+ frame->eax, frame->ecx, frame->edx, frame->ebx,
frame->esp, frame->ebp, frame->esi, frame->edi,
frame->eip, frame->flags,
- frame->cs, frame->ds, frame->ds, frame->es
+ frame->cs, frame->ds, frame->ds, frame->es,
// assume ss == ds
+ frame->fs, frame->gs
};
const char* const bufferStart = buffer;