remake  4.3+dbg-1.5
debug.h
Go to the documentation of this file.
1 /* Debugging macros and interface.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 This file is part of GNU Make.
4 
5 GNU Make is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3 of the License, or (at your option) any later
8 version.
9 
10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see <http://www.gnu.org/licenses/>. */
16 
17 #ifndef DEBUG_H
18 #define DEBUG_H
19 
20 #include "types.h"
21 
30 typedef enum {
31  DB_NONE = 0x000,
32  DB_BASIC = 0x001,
34  DB_VERBOSE = 0x002,
35  DB_JOBS = 0x004,
39  DB_IMPLICIT = 0x008,
43  DB_TRACE = 0x010,
44  DB_SHELL = 0x020,
45  DB_MAKEFILES = 0x100,
47  DB_CALL = 0x400,
48  DB_UPDATE_GOAL = 0x800,
49  DB_ALL = 0xfff
51 
52 typedef enum {
57 
58 typedef enum {
61 
68 
70 extern int db_level;
71 
77 extern int in_debugger;
78 
79 #include <setjmp.h>
80 extern jmp_buf debugger_loop;
81 
84 struct stringlist
85 {
86  const char **list;
87  unsigned int idx;
88  unsigned int max;
89 };
90 
91 extern int debug_flag;
92 
94 extern int no_extended_errors;
95 
97 extern int show_variable_definitions;
98 
100 extern bool b_debugger_goal;
101 
103 extern bool b_debugger_preread;
104 
110 extern unsigned int i_debugger_stepping;
111 
117 extern unsigned int i_debugger_nexting;
118 
121 extern unsigned int debugger_on_error;
122 
125 extern unsigned int debugger_enabled;
126 
127 extern stringlist_t *db_flags;
128 
129 #define ISDB(_l) ((_l)&db_level)
130 
131 /* When adding macros to this list be sure to update the value of
132  XGETTEXT_OPTIONS in the po/Makevars file. */
133 
135 #define DBPRINT(_x) \
136  printf _x; fflush (stdout)
137 
139 #define DBPRINTS(_x, _depth) \
140  print_spaces (_depth); \
141  DBPRINT(_x)
142 
146 #define DBS(_l,_x) \
147  do { \
148  if(ISDB(_l)) { \
149  DBPRINTS(_x, depth); \
150  } \
151  } while(0)
152 
156 #define DBSD(_l,_x,_depth) \
157  do { \
158  if(ISDB(_l)) { \
159  DBPRINTS(_x, _depth); \
160  } \
161  } while(0)
162 
163 extern int db_level;
164 
165 #define ISDB(_l) ((_l)&db_level)
166 
167 #define DBF(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \
168  printf (_x, file->name); \
169  fflush (stdout);} }while(0)
170 
171 #define DB(_l,_x) do{ if(ISDB(_l)) {printf _x; fflush (stdout);} }while(0)
172 
173 
174 #endif /*DEBUG_H*/
Definition: debug.h:31
Miscellaneous types.
unsigned int idx
Definition: debug.h:87
Definition: debug.h:45
Definition: debug.h:48
int in_debugger
bool b_debugger_preread
stringlist_t * db_flags
bool b_debugger_goal
debug_level_mask_t debug_dummy_level_mask
unsigned int debugger_enabled
unsigned int debugger_on_error
Definition: debug.h:39
const char ** list
Definition: debug.h:86
debug_enter_debugger_t debug_dummy_enter_debugger_mask
debug_level_mask_t
debug masks which control tracing output.
Definition: debug.h:30
int show_variable_definitions
Definition: debug.h:43
debug_enter_debugger_t
Definition: debug.h:52
unsigned int i_debugger_nexting
Definition: debug.h:53
Definition: debug.h:49
Definition: debug.h:46
int no_extended_errors
Definition: debug.h:54
Definition: debug.h:44
debug_dummy_t
Definition: debug.h:58
jmp_buf debugger_loop
int db_level
Definition: debug.h:163
unsigned int max
Definition: debug.h:88
Definition: debug.h:55
Definition: debug.h:59
The structure used to hold the list of strings given.
Definition: debug.h:84
Definition: debug.h:32
Definition: debug.h:35
int debug_flag
Definition: debug.h:47
unsigned int i_debugger_stepping
Definition: debug.h:34