next up previous contents index
Next: Reference Manual Up: User Guide Previous: Exceptions   Contents   Index


Debugging

libaldor comes with a debug version, which makes various assertions about the arguments of the functions called. Its most important debugging feature is probably the ability to bound check all accesses into PrimitiveArray, PackedPrimitiveArray, PrimitiveMemoryBlock, List and String at runtime. To use the debug version of the library, just compile all your files with the
-dDEBUG
option, and add the option
-laldord
rather than -laldor when building an executable. It is also preferable when debugging to add the -q1 option in order to prevent inlining.

libaldor also provides a couple of macros to help you debug your applications:

TRACE(message,value):
has no effect on normal compilation, but sends message followed by value and a newline to stderr when compiled with the -dTRACE option.
AGAT(stream,value):
has no effect on normal compilation, but sends value to the Agat stream stream when compiled with the -dAGAT option. This option is only available if you have Agat installed (see http://www-sop.inria.fr/cafe/Olivier.Arsac/agat/agat.html).

Another useful tracing feature is the -Wdebug option of the compiler, which is now supported by libaldor: if you compile any source file, say foo.as with the -Wdebug option, and then call traceActivate in your program, then any entry and exit of functions from foo.as will be traced, until you call traceStop in your program. See traceActivate for an example.


next up previous contents index
Next: Reference Manual Up: User Guide Previous: Exceptions   Contents   Index
Manuel Bronstein 2004-06-28