Author: andreasf Date: 2010-06-27 22:16:59 +0200 (Sun, 27 Jun 2010) New Revision: 37281 Changeset: http://dev.haiku-os.org/changeset/37281/haiku Ticket: http://dev.haiku-os.org/ticket/6139 Ticket: http://dev.haiku-os.org/ticket/6160 Modified: haiku/trunk/headers/private/kernel/arch/ppc/arch_debug.h haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp Log: kernel_ppc: Save caller's stack pointer in arch_debug_save_registers Suggested by Ingo in ticket #6139. Code is adapted from x86. Note that on ppc64 GPR1 needs to be 64-bit, thus the choice of addr_t. Resolves part of ticket #6160. Modified: haiku/trunk/headers/private/kernel/arch/ppc/arch_debug.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/ppc/arch_debug.h 2010-06-27 17:56:05 UTC (rev 37280) +++ haiku/trunk/headers/private/kernel/arch/ppc/arch_debug.h 2010-06-27 20:16:59 UTC (rev 37281) @@ -10,6 +10,7 @@ struct arch_debug_registers { + addr_t r1; }; Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2010-06-27 17:56:05 UTC (rev 37280) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2010-06-27 20:16:59 UTC (rev 37281) @@ -258,6 +258,9 @@ void arch_debug_save_registers(struct arch_debug_registers* registers) { + // get the caller's frame pointer + stack_frame* frame = (stack_frame*)get_current_stack_frame(); + registers->r1 = (addr_t)frame->previous; }