Debugging Your Code

This library provides several utility routines for debugging purpose. Almost all debugging utilities work if _CEL_DEBUG_ macro is defined as non-0 value.

Output Debug Messages

To output debug messages on the console or development IDE debugging view, you can use cel_dbgPrintf function. This function works much like as std::printf but it also outputs the messages on the IDE (on Windows, it internally uses OutputDebugString function to do it). And it is disabled when _CEL_DEBUG_ is defined as 0 or not defined.

Assertion Macros

This library provides CEL_ASSERT for assertion purpose. This function calls abort() if the condition specified is not true. The following code illustrates how to use it:
void some_routine(Image *inImage)
{
    CEL_ASSERT(inImage);

    ...
}

Logs

The library internally processes several exceptions thrown by low-level functions and you usually see only the top-level thrown exceptions. It's very useful in normal case not to see these internal exceptions but in the debugging phase, it may be useful if you can see these exceptions.

_PXLL_DEBUG_FILE

There's an environment variable named _PXLL_DEBUG_FILE, if you set the value, the library uses logs all the exceptions thrown to the file.

Debug version of the library

The library shiped for the developers only contains released version of the library. On Windows, it may limit the debugging ability of the codes you've written and if you want to get the debug version, please contact us . The notes below are for the debug version.

CEL_ASSERT implementation

On Windows, CEL_ASSERT internally calls _CrtDbgReport. with _CRT_ASSERT report type. And the first call to PixelLiveSystem::create() initializes the output of debugging messages using _CrtSetReportMode and _CrtSetReportFile functions. The following table illustrates the configuration:
Report TypeReport Mode
_CRT_WARN _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG
_CRT_ERROR _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_WNDW
_CRT_ASSERT _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_WNDW

And all the messages are written to stderr. You can also explicitly change this behavior by calling _CrtSetReportMode and _CrtSetReportFile.


This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:22:54 2008.