1 /* 2 * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8 #ifndef _KERNEL_ARCH_DEBUG_H 9 #define _KERNEL_ARCH_DEBUG_H 10 11 12 #include <SupportDefs.h> 13 14 #include <cpu.h> 15 16 17 struct kernel_args; 18 struct thread; 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 status_t arch_debug_init(kernel_args *args); 26 void *arch_debug_get_caller(void); 27 int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, 28 int32 skipIframes, int32 skipFrames, bool userOnly); 29 void* arch_debug_get_interrupt_pc(bool* _isSyscall); 30 bool arch_debug_contains_call(struct thread *thread, const char *symbol, 31 addr_t start, addr_t end); 32 void arch_debug_save_registers(int *); 33 void arch_debug_unset_current_thread(void); 34 void arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, 35 void (*function)(void*), void* parameter); 36 37 bool arch_is_debug_variable_defined(const char* variableName); 38 status_t arch_set_debug_variable(const char* variableName, uint64 value); 39 status_t arch_get_debug_variable(const char* variableName, uint64* value); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* _KERNEL_ARCH_DEBUG_H */ 46