]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/debug.h
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 #ifndef _KERN_DEBUG_H_
32 #define _KERN_DEBUG_H_
34 #include <sys/cdefs.h>
38 extern unsigned int systemLogDiags
;
40 #ifdef MACH_KERNEL_PRIVATE
42 extern unsigned int halt_in_debugger
;
44 extern unsigned int switch_debugger
;
46 extern unsigned int current_debugger
;
48 #define KDP_CUR_DB 0x1
49 #define KDB_CUR_DB 0x2
51 extern unsigned int active_debugger
;
52 extern unsigned int debug_mode
;
53 extern unsigned int disableDebugOuput
;
55 extern unsigned int panicDebugging
;
56 extern unsigned int logPanicDataToScreen
;
58 extern int db_run_mode
;
60 /* modes the system may be running in */
66 #define STEP_CONTINUE 4
67 #define STEP_INVISIBLE 5
69 #define STEP_TRACE 7 /* Show all calls to functions and returns */
71 extern const char *panicstr
;
72 extern volatile unsigned int nestedpanic
;
74 extern char *debug_buf
;
75 extern char *debug_buf_ptr
;
76 extern unsigned int debug_buf_size
;
78 extern void debug_log_init(void);
79 extern void debug_putc(char);
81 extern void panic_init(void);
83 #endif /* MACH_KERNEL_PRIVATE */
92 #define DB_KDP_BP_DIS 0x80
93 #define DB_LOG_PI_SCRN 0x100
94 #define DB_KDP_GETC_ENA 0x200
96 #define DB_KERN_DUMP_ON_PANIC 0x400 /* Trigger core dump on panic*/
97 #define DB_KERN_DUMP_ON_NMI 0x800 /* Trigger core dump on NMI */
98 #define DB_DBG_POST_CORE 0x1000 /*Wait in debugger after NMI core */
99 #define DB_PANICLOG_DUMP 0x2000 /* Send paniclog on panic,not core*/
101 #endif /* KERNEL_PRIVATE */
105 extern void panic(const char *string
, ...);
109 #endif /* _KERN_DEBUG_H_ */