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-2024 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 #ifndef BU_DEBUG_H
22 #define BU_DEBUG_H
23 
24 #include "common.h"
25 #include "bu/defines.h"
26 
27 __BEGIN_DECLS
28 
29 /** @addtogroup bu_debug Debugging
30  *
31  * @brief
32  * Debugging definitions.
33  *
34  */
35 /** @{ */
36 /** @file bu/debug.h */
37 
38 /**
39  * controls the libbu debug level
40  */
41 BU_EXPORT extern unsigned 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_UNUSED_0 0x00000002 /* Unallocated */
55 #define BU_DEBUG_UNUSED_1 0x00000004 /* Unallocated */
56 #define BU_DEBUG_UNUSED_2 0x00000008 /* Unallocated */
57 
58 #define BU_DEBUG_PARALLEL 0x00000010 /* Parallel debug logging */
59 #define BU_DEBUG_UNUSED_3 0x00000020 /* Unallocated */
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_4 0x00002000 /* Unallocated */
70 #define BU_DEBUG_UNUSED_5 0x00004000 /* Unallocated */
71 #define BU_DEBUG_UNUSED_6 0x00008000 /* Unallocated */
72 
73 #define BU_DEBUG_TABDATA 0x00010000 /* LIBBN: tabdata */
74 #define BU_DEBUG_UNUSED_7 0x00020000 /* Unallocated */
75 #define BU_DEBUG_UNUSED_8 0x00040000 /* Unallocated */
76 #define BU_DEBUG_UNUSED_9 0x00080000 /* Unallocated */
77 
78 /* Format string for bu_printb() */
79 #define BU_DEBUG_FORMAT "\020" /* print hex */ \
80  "\024UNUSED_9" \
81  "\023UNUSED_8" \
82  "\022UNUSED_7" \
83  "\021TABDATA" \
84  "\020UNUSED_6" \
85  "\017UNUSED_5" \
86  "\016UNUSED_4" \
87  "\015PATHS" \
88  "\014MAPPED_FILE" \
89  "\013AVS" \
90  "\012PTBL" \
91  "\011MATH" \
92  "\010ATTACH" \
93  "\7BACKTRACE" \
94  "\6UNUSED_3" \
95  "\5PARALLEL" \
96  "\4UNUSED_2" \
97  "\3UNUSED_1" \
98  "\2UNUSED_0" \
99  "\1COREDUMP"
100 
101 /** @} */
102 
103 __END_DECLS
104 
105 #endif /* BU_DEBUG_H */
106 
107 /*
108  * Local Variables:
109  * mode: C
110  * tab-width: 8
111  * indent-tabs-mode: t
112  * c-file-style: "stroustrup"
113  * End:
114  * ex: shiftwidth=4 tabstop=8
115  */
Header file for the BRL-CAD common definitions.
unsigned int bu_debug