xref: /haiku/headers/private/kernel/arch/debug.h (revision 508f54795f39c3e7552d87c95aae9dd8ec6f505b)
1 /*
2  * Copyright 2005-2009, 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 <arch_debug.h>
15 #include <cpu.h>
16 
17 
18 struct kernel_args;
19 struct thread;
20 
21 
22 // arch_debug_get_stack_trace() flags
23 #define STACK_TRACE_KERNEL	0x01
24 #define STACK_TRACE_USER	0x02
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 status_t arch_debug_init(kernel_args *args);
32 void arch_debug_stack_trace(void);
33 void *arch_debug_get_caller(void);
34 int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
35 		int32 skipIframes, int32 skipFrames, uint32 flags);
36 void* arch_debug_get_interrupt_pc(bool* _isSyscall);
37 bool arch_debug_contains_call(struct thread *thread, const char *symbol,
38 		addr_t start, addr_t end);
39 void arch_debug_save_registers(struct arch_debug_registers* registers);
40 void arch_debug_unset_current_thread(void);
41 void arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer,
42 		void (*function)(void*), void* parameter);
43 
44 bool arch_is_debug_variable_defined(const char* variableName);
45 status_t arch_set_debug_variable(const char* variableName, uint64 value);
46 status_t arch_get_debug_variable(const char* variableName, uint64* value);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif	/* _KERNEL_ARCH_DEBUG_H */
53