BRL-CAD
debug.h
Go to the documentation of this file.
1 /* D E B U G . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /** @defgroup io Input/Output */
22 /** @defgroup debug Debugging */
23 
24 /** @file debug.h
25  *
26  */
27 #ifndef BU_DEBUG_H
28 #define BU_DEBUG_H
29 
30 #include "common.h"
31 #include "bu/defines.h"
32 
34 
35 /** @addtogroup debug Debugging */
36 /** @{ */
37 
38 /**
39  * controls the libbu debug level
40  */
41 BU_EXPORT extern int bu_debug;
42 
43 /**
44  * Section for BU_DEBUG values
45  *
46  * These can be set from the command-line of RT-compatible programs
47  * using the "-!" option.
48  *
49  * These definitions are each for one bit.
50  */
51 #define BU_DEBUG_OFF 0 /* No debugging */
52 
53 #define BU_DEBUG_COREDUMP 0x00000001 /* bu_bomb() should dump core on exit */
54 #define BU_DEBUG_MEM_CHECK 0x00000002 /* Mem barrier & leak checking */
55 #define BU_DEBUG_MEM_LOG 0x00000004 /* Print all dynamic memory operations */
56 #define BU_DEBUG_UNUSED_0 0x00000008 /* unused */
57 
58 #define BU_DEBUG_PARALLEL 0x00000010 /* Parallel debug logging */
59 #define BU_DEBUG_MEM_QCHECK 0x00000020 /* Fast mem leak checking (won't work with corruption) */
60 #define BU_DEBUG_BACKTRACE 0x00000040 /* Log backtrace details during abnormal exit */
61 #define BU_DEBUG_ATTACH 0x00000080 /* Waits for a debugger to attach during a crash */
62 
63 #define BU_DEBUG_MATH 0x00000100 /* Fundamental math routines (plane.c, mat.c) */
64 #define BU_DEBUG_PTBL 0x00000200 /* bu_ptbl_*() logging */
65 #define BU_DEBUG_AVS 0x00000400 /* bu_avs_*() logging */
66 #define BU_DEBUG_MAPPED_FILE 0x00000800 /* bu_mapped_file logging */
67 
68 #define BU_DEBUG_PATHS 0x00001000 /* File and path debug logging */
69 #define BU_DEBUG_UNUSED_1 0x00002000 /* unused */
70 #define BU_DEBUG_UNUSED_2 0x00004000 /* unused */
71 #define BU_DEBUG_UNUSED_3 0x00008000 /* unused */
72 
73 #define BU_DEBUG_TABDATA 0x00010000 /* LIBBN: tabdata */
74 #define BU_DEBUG_UNUSED_4 0x00020000 /* unused */
75 #define BU_DEBUG_UNUSED_5 0x00040000 /* unused */
76 #define BU_DEBUG_UNUSED_6 0x00080000 /* unused */
77 
78 /* Format string for bu_printb() */
79 #define BU_DEBUG_FORMAT \
80  "\020\
81 \025TABDATA\
82 \015?\
83 \014MAPPED_FILE\013AVS\012PTBL\011MATH\010?\7?\6MEM_QCHECK\5PARALLEL\
84 \4?\3MEM_LOG\2MEM_CHECK\1COREDUMP"
85 
86 /** @} */
87 
89 
90 #endif /* BU_DEBUG_H */
91 
92 /*
93  * Local Variables:
94  * mode: C
95  * tab-width: 8
96  * indent-tabs-mode: t
97  * c-file-style: "stroustrup"
98  * End:
99  * ex: shiftwidth=4 tabstop=8
100  */
Header file for the BRL-CAD common definitions.
#define __BEGIN_DECLS
Definition: common.h:73
int bu_debug
Definition: globals.c:87
#define __END_DECLS
Definition: common.h:74