sparc: fix debug support

Declare and use the correct registers to define a stack frame.

Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
Reviewed-on: https://review.haiku-os.org/c/1327
Reviewed-by: Alex von Gluck IV <[email protected]>
This commit is contained in:
PulkoMandy
2019-03-30 15:23:15 +00:00
committed by waddlesplash
parent 3bfbec8336
commit 8ff82ee2d4
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
struct sparc_debug_cpu_state { struct sparc_debug_cpu_state {
uint32 dummy; uint64 pc;
uint64 i6; // frame pointer
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
@@ -18,7 +18,7 @@ struct stack_frame {
status_t status_t
arch_debug_get_instruction_pointer(debug_context *context, thread_id thread, arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
void **ip, void **stackFrameAddress) void **pc, void **stackFrameAddress)
{ {
// get the CPU state // get the CPU state
debug_cpu_state cpuState; debug_cpu_state cpuState;
@@ -26,8 +26,8 @@ arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
if (error != B_OK) if (error != B_OK)
return error; return error;
*ip = (void*)cpuState.rip; *pc = (void*)cpuState.pc;
*stackFrameAddress = (void*)cpuState.rbp; *stackFrameAddress = (void*)cpuState.i6;
return B_OK; return B_OK;
} }