xref: /haiku/headers/private/kernel/debug.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de
3  * Distributed under the terms of the Haiku License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef _KERNEL_DEBUG_H
9 #define _KERNEL_DEBUG_H
10 
11 
12 #include <OS.h>
13 
14 struct kernel_args;
15 
16 
17 #if DEBUG
18 #	define ASSERT(x) \
19 	if (x) {} else { panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); }
20 #else
21 #	define ASSERT(x)
22 #endif
23 
24 extern int dbg_register_file[B_MAX_CPU_COUNT][14];
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 extern status_t debug_init(struct kernel_args *args);
32 extern status_t	debug_init_post_vm(struct kernel_args *args);
33 extern status_t	debug_init_post_modules(struct kernel_args *args);
34 extern void debug_early_boot_message(const char *string);
35 extern void debug_puts(const char *s, int32 length);
36 extern bool debug_debugger_running(void);
37 extern void debug_stop_screen_debug_output(void);
38 
39 extern void _user_debug_output(const char *userString);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif	/* _KERNEL_DEBUG_H */
46