From ab0ad5e92b8ef2853f19ef8fa9bac888295f645f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 1 Mar 2007 14:39:09 +0000 Subject: [PATCH] Implemented printing the stack trace in vm_page_fault() for PPC as well. Not tested, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20284 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/vm.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index fe9f2fce4f..26e1402b99 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -2888,20 +2888,31 @@ vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, #if 1 if (area) { struct stack_frame { - #ifdef __INTEL__ + #if defined(__INTEL__) || defined(__POWERPC__) struct stack_frame* previous; void* return_address; #else // ... #endif - }; + } frame; +#ifdef __INTEL__ struct iframe *iframe = i386_get_user_iframe(); if (iframe == NULL) panic("iframe is NULL!"); - struct stack_frame frame; status_t status = user_memcpy(&frame, (void *)iframe->ebp, sizeof(struct stack_frame)); +#elif defined(__POWERPC__) + struct iframe *iframe = ppc_get_user_iframe(); + if (iframe == NULL) + panic("iframe is NULL!"); + + status_t status = user_memcpy(&frame, (void *)iframe->r1, + sizeof(struct stack_frame)); +#else +# warn "vm_page_fault() stack trace won't work" + status = B_ERROR; +#endif dprintf("stack trace:\n"); while (status == B_OK) {