Download see nana user manual

Transcript
26
GNU Nana: improved support for assertions and logging in C and C++
Thus you can have debugging under GCC whilst the code is still portable to other
compilers. However debugging information will not be available on other platforms.
Note: the argument list is surrounded by two sets of brackets. For example:
VDL(("haze in darwin = %d\n", 3.4));
int
DL LEVEL
Used to enable and disable logging independently of guard expressions.
2
1
0
Macro
Always print message
Print message only if the guard expression is true.
Never print any messages.
Defaults to 1.
text
DL DEFAULT HANDLER
The default handler for printing which is simply the name of the printing function.
Macro
Defaults to fprintf
bool
text
flag
DL DEFAULT GUARD
Macro
DL DEFAULT PARAMS
Macro
Defaults to TRUE.
Defaults to stderr
DL SHOW TIME
Macro
Each message can be given an individual time stamp by dening DL_SHOW_TIME. This
causes the _L_gettime routine to be called before each message which generates the
timestamp. A default version is provided by the nana library.
4.9 GDB.h: sending plain gdb commands to the debugger
`GDB.h' provides macros for generating user specied commands in the output of the `nana'
command. They are not included by default in the `nana.h' le.
void
GDB (command)
Macro
Emit a single line command when running this le through `nana'. Note that each line
must be passed o separately to the `GDB' macro.
This could be used to set debugger options or to dene procedures inside `gdb', e.g.