From 8ff82ee2d475da38fde655341aa98f9cf7f9d474 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Thu, 28 Mar 2019 08:04:58 +0100 Subject: [PATCH] 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 --- headers/os/arch/sparc/arch_debugger.h | 3 ++- src/kits/debug/arch/sparc/arch_debug_support.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/headers/os/arch/sparc/arch_debugger.h b/headers/os/arch/sparc/arch_debugger.h index eaa14c0df9..2965882dba 100644 --- a/headers/os/arch/sparc/arch_debugger.h +++ b/headers/os/arch/sparc/arch_debugger.h @@ -7,7 +7,8 @@ struct sparc_debug_cpu_state { - uint32 dummy; + uint64 pc; + uint64 i6; // frame pointer } __attribute__((aligned(8))); diff --git a/src/kits/debug/arch/sparc/arch_debug_support.cpp b/src/kits/debug/arch/sparc/arch_debug_support.cpp index 83f6b35cdf..553e72da27 100644 --- a/src/kits/debug/arch/sparc/arch_debug_support.cpp +++ b/src/kits/debug/arch/sparc/arch_debug_support.cpp @@ -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; }