remake  4.3+dbg-1.5
Data Structures | Macros | Enumerations | Variables
debug.h File Reference
#include "types.h"
#include <setjmp.h>

Go to the source code of this file.

Data Structures

struct  stringlist
 The structure used to hold the list of strings given. More...
 

Macros

#define ISDB(_l)   ((_l)&db_level)
 
#define DBPRINT(_x)   printf _x; fflush (stdout)
 
#define DBPRINTS(_x, _depth)
 
#define DBS(_l, _x)
 
#define DBSD(_l, _x, _depth)
 
#define ISDB(_l)   ((_l)&db_level)
 
#define DBF(_l, _x)
 
#define DB(_l, _x)   do{ if(ISDB(_l)) {printf _x; fflush (stdout);} }while(0)
 

Enumerations

enum  debug_level_mask_t {
  DB_NONE = 0x000, DB_BASIC = 0x001, DB_VERBOSE = 0x002, DB_JOBS = 0x004,
  DB_IMPLICIT = 0x008, DB_TRACE = 0x010, DB_SHELL = 0x020, DB_MAKEFILES = 0x100,
  DB_READ_MAKEFILES = 0x200, DB_CALL = 0x400, DB_UPDATE_GOAL = 0x800, DB_ALL = 0xfff
}
 debug masks which control tracing output. More...
 
enum  debug_enter_debugger_t { DEBUGGER_ON_ERROR = 0x1, DEBUGGER_ON_FATAL = 0x2, DEBUGGER_ON_SIG = 0x4 }
 
enum  debug_dummy_t { DEBUGGER_QUIT_RC = 77 }
 

Variables

debug_level_mask_t debug_dummy_level_mask
 
debug_enter_debugger_t debug_dummy_enter_debugger_mask
 
int db_level
 
int in_debugger
 
jmp_buf debugger_loop
 
int debug_flag
 
int no_extended_errors
 
int show_variable_definitions
 
bool b_debugger_goal
 
bool b_debugger_preread
 
unsigned int i_debugger_stepping
 
unsigned int i_debugger_nexting
 
unsigned int debugger_on_error
 
unsigned int debugger_enabled
 
stringlist_tdb_flags
 

Macro Definition Documentation

◆ DB

#define DB (   _l,
  _x 
)    do{ if(ISDB(_l)) {printf _x; fflush (stdout);} }while(0)

◆ DBF

#define DBF (   _l,
  _x 
)
Value:
do{ if(ISDB(_l)) {print_spaces (depth); \
printf (_x, file->name); \
fflush (stdout);} }while(0)
const char * name
Definition: filedef.h:36
void print_spaces(unsigned int)
#define ISDB(_l)
Definition: debug.h:165
Definition: filedef.h:34

◆ DBPRINT

#define DBPRINT (   _x)    printf _x; fflush (stdout)

Debugged print

◆ DBPRINTS

#define DBPRINTS (   _x,
  _depth 
)
Value:
print_spaces (_depth); \
DBPRINT(_x)
void print_spaces(unsigned int)

Debugged print indented a number of spaces given by "_depth"

◆ DBS

#define DBS (   _l,
  _x 
)
Value:
do { \
if(ISDB(_l)) { \
DBPRINTS(_x, depth); \
} \
} while(0)
#define ISDB(_l)
Definition: debug.h:165

Debugged print if debug mask is set indented a number of spaces implied by global variable "depth"

◆ DBSD

#define DBSD (   _l,
  _x,
  _depth 
)
Value:
do { \
if(ISDB(_l)) { \
DBPRINTS(_x, _depth); \
} \
} while(0)
#define ISDB(_l)
Definition: debug.h:165

Debugged print if debug mask is set indented a number of spaces given by "_depth"

◆ ISDB [1/2]

#define ISDB (   _l)    ((_l)&db_level)

◆ ISDB [2/2]

#define ISDB (   _l)    ((_l)&db_level)

Enumeration Type Documentation

◆ debug_dummy_t

Enumerator
DEBUGGER_QUIT_RC 

debugger issued a "quit" command.

◆ debug_enter_debugger_t

Enumerator
DEBUGGER_ON_ERROR 

Enter debugger on any error

DEBUGGER_ON_FATAL 

Enter debugger on a fatal error

DEBUGGER_ON_SIG 

Enter debugger on getting a signal

◆ debug_level_mask_t

debug masks which control tracing output.

Imagine the below enums values as define'd values rather than distinct values of an enum. The enum is more (gdb) debugger friendly in showing what's set (e.g. DB_NONE, DB_ALL, or a single value and in entering expressons (e.g print db_level & DB_BASIC).

Enumerator
DB_NONE 

Mask when none of the below are set.

DB_BASIC 

targets which need to be made and status; also set when tracing or debugging

DB_VERBOSE 

A more verbose trace

DB_JOBS 

Prints messages giving details on the invocation of specific subcommands. Can be set via –debug=jobs

DB_IMPLICIT 

Prints messages describing the implicit rule searches for each target. Can be set via –debug=implicit

DB_TRACE 

tracing

DB_SHELL 

add +x to SHELL invocations

DB_MAKEFILES 
DB_READ_MAKEFILES 

Reading makefiles

DB_CALL 

GNU Make function call and returns

DB_UPDATE_GOAL 

GNU Make function call and returns

DB_ALL 

Bitmask for all of the above.

Variable Documentation

◆ b_debugger_goal

bool b_debugger_goal

If true, enter the debugger before updating goal target.

◆ b_debugger_preread

bool b_debugger_preread

If true, enter the debugger before reading any makefiles.

◆ db_flags

stringlist_t* db_flags

◆ db_level

int db_level

bitmask of debug_level_mask values.

Referenced by dbg_cmd_show().

◆ debug_dummy_enter_debugger_mask

debug_enter_debugger_t debug_dummy_enter_debugger_mask

◆ debug_dummy_level_mask

debug_level_mask_t debug_dummy_level_mask

These variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. It is used to allow one refer to above enumeration values in a debugger and debugger expressions

◆ debug_flag

int debug_flag

◆ debugger_enabled

unsigned int debugger_enabled

If nonzero, we have requested some sort of debugging.

◆ debugger_loop

jmp_buf debugger_loop

◆ debugger_on_error

unsigned int debugger_on_error

If nonzero, enter the debugger if we hit a fatal error.

◆ i_debugger_nexting

unsigned int i_debugger_nexting

If nonzero, we are debugging after each "next" for that many times. When we have a value 1, then we actually run the debugger read loop. Otherwise we decrement the step count.

◆ i_debugger_stepping

unsigned int i_debugger_stepping

If nonzero, we are debugging after each "step" for that many times. When we have a value 1, then we actually run the debugger read loop. Otherwise we decrement the step count.

◆ in_debugger

int in_debugger

If 0 (or false) we are not in the debugger command read loop. If 1 (or true) we are in the debugger command read loop. If DEBUGGER_QUIT_RC we've requested to quit.

◆ no_extended_errors

int no_extended_errors

If 1, we don't give additional error reporting information.

◆ show_variable_definitions

int show_variable_definitions

If 1, we show variable definitions