Author: axeld Date: 2009-10-18 21:50:13 +0200 (Sun, 18 Oct 2009) New Revision: 33642 Changeset: http://dev.haiku-os.org/changeset/33642/haiku Modified: haiku/trunk/headers/private/kernel/arch/debug.h haiku/trunk/src/system/kernel/arch/arm/arch_debug.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp haiku/trunk/src/system/kernel/debug/debug.cpp Log: * Added an arch_debug_stack_trace() function that is called from the KDL loop in case there aren't any KDL commands available yet. Modified: haiku/trunk/headers/private/kernel/arch/debug.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/debug.h 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/headers/private/kernel/arch/debug.h 2009-10-18 19:50:13 UTC (rev 33642) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx + * Copyright 2005-2009, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -23,6 +23,7 @@ #endif status_t arch_debug_init(kernel_args *args); +void arch_debug_stack_trace(void); void *arch_debug_get_caller(void); int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, int32 skipIframes, int32 skipFrames, bool userOnly); Modified: haiku/trunk/src/system/kernel/arch/arm/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/arm/arch_debug.cpp 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/src/system/kernel/arch/arm/arch_debug.cpp 2009-10-18 19:50:13 UTC (rev 33642) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008, Haiku Inc. All rights reserved. + * Copyright 2003-2009, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -241,6 +241,12 @@ } +void +arch_debug_stack_trace(void) +{ +} + + void * arch_debug_get_caller(void) { @@ -376,19 +382,20 @@ return B_NO_ERROR; } + void arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, - void (*function)(void*), void* parameter) + void (*function)(void*), void* parameter) { - // TODO: Implement! Most likely in assembly. - longjmp(jumpBuffer, 1); + // TODO: Implement! Most likely in assembly. + longjmp(jumpBuffer, 1); } void arch_debug_unset_current_thread(void) { - // TODO: Implement! + // TODO: Implement! } Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-10-18 19:50:13 UTC (rev 33642) @@ -253,6 +253,12 @@ } +void +arch_debug_stack_trace(void) +{ +} + + bool arch_debug_contains_call(struct thread *thread, const char *symbol, addr_t start, addr_t end) Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-10-18 19:50:13 UTC (rev 33642) @@ -259,6 +259,13 @@ } +void +arch_debug_stack_trace(void) +{ + stack_trace(0, NULL); +} + + bool arch_debug_contains_call(struct thread *thread, const char *symbol, addr_t start, addr_t end) Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-10-18 19:50:13 UTC (rev 33642) @@ -883,6 +883,13 @@ // #pragma mark - +void +arch_debug_stack_trace(void) +{ + stack_trace(0, NULL); +} + + bool arch_debug_contains_call(struct thread *thread, const char *symbol, addr_t start, addr_t end) Modified: haiku/trunk/src/system/kernel/debug/debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/debug/debug.cpp 2009-10-18 19:20:10 UTC (rev 33641) +++ haiku/trunk/src/system/kernel/debug/debug.cpp 2009-10-18 19:50:13 UTC (rev 33642) @@ -733,6 +733,9 @@ } } + if (!has_debugger_command("help")) + arch_debug_stack_trace(); + int32 continuableLine = -1; // Index of the previous command line, if the command returned // B_KDEBUG_CONT, i.e. asked to be repeatable, -1 otherwise.