1 /* 2 * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef KERNEL_ARCH_USER_DEBUGGER_H 6 #define KERNEL_ARCH_USER_DEBUGGER_H 7 8 #include <debugger.h> 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 // Enable this to get support for kernel breakpoints. 15 //#define KERNEL_BREAKPOINTS 1 16 17 struct arch_team_debug_info; 18 struct arch_thread_debug_info; 19 20 void arch_clear_team_debug_info(struct arch_team_debug_info *info); 21 void arch_destroy_team_debug_info(struct arch_team_debug_info *info); 22 void arch_clear_thread_debug_info(struct arch_thread_debug_info *info); 23 void arch_destroy_thread_debug_info(struct arch_thread_debug_info *info); 24 25 void arch_update_thread_single_step(); 26 27 void arch_set_debug_cpu_state(const struct debug_cpu_state *cpuState); 28 void arch_get_debug_cpu_state(struct debug_cpu_state *cpuState); 29 30 status_t arch_set_breakpoint(void *address); 31 status_t arch_clear_breakpoint(void *address); 32 status_t arch_set_watchpoint(void *address, uint32 type, int32 length); 33 status_t arch_clear_watchpoint(void *address); 34 bool arch_has_breakpoints(struct arch_team_debug_info *info); 35 36 #if KERNEL_BREAKPOINTS 37 status_t arch_set_kernel_breakpoint(void *address); 38 status_t arch_clear_kernel_breakpoint(void *address); 39 status_t arch_set_kernel_watchpoint(void *address, uint32 type, int32 length); 40 status_t arch_clear_kernel_watchpoint(void *address); 41 #endif 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #include <arch_user_debugger.h> 48 49 #endif // KERNEL_ARCH_USER_DEBUGGER_H 50