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 <kallisti5@unixzen.com>
This commit is contained in:
PulkoMandy 2019-03-28 08:04:58 +01:00 committed by waddlesplash
parent 3bfbec8336
commit 8ff82ee2d4
2 changed files with 5 additions and 4 deletions

View File

@ -7,7 +7,8 @@
struct sparc_debug_cpu_state {
uint32 dummy;
uint64 pc;
uint64 i6; // frame pointer
} __attribute__((aligned(8)));

View File

@ -18,7 +18,7 @@ struct stack_frame {
status_t
arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
void **ip, void **stackFrameAddress)
void **pc, void **stackFrameAddress)
{
// get the CPU state
debug_cpu_state cpuState;
@ -26,8 +26,8 @@ arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
if (error != B_OK)
return error;
*ip = (void*)cpuState.rip;
*stackFrameAddress = (void*)cpuState.rbp;
*pc = (void*)cpuState.pc;
*stackFrameAddress = (void*)cpuState.i6;
return B_OK;
}