GLOW API version 1.0 reference

Back to
Table of contents


module glowDebug

General information

The glowDebug module contains debugging facilities provided and used internally by The GLOW Toolkit. You may also use them in your application. The facilities provided include support for assertions, catching signals, and tracing the call stack. The module includes several classes, but normally you should use the provided macros instead of referring to the classes directly, so that debugging can be turned on and off using the preprocessor symbol GLOW_OPTION_DEBUG.

Macros

GLOW_DEBUG(expr, "message")

If expr is true, prints the message, the file name and line number, and the call stack, and aborts. Takes effect only if GLOW_OPTION_DEBUG is defined.

GLOW_WARNING(expr, "message")

If expr is true, prints the message, the file name and line number, and the call stack, but does not abort. Takes effect only if GLOW_OPTION_DEBUG is defined.

GLOW_ASSERT(expr)

If expr is false, prints out an assertion failure message, the file name and line number, and the call stack, and aborts. Takes effect only if GLOW_OPTION_DEBUG is defined.

GLOW_DEBUGSCOPE("name")

Appends the given name to the call stack. The name will be removed when the current scope exits. Typically, you will want to insert this statement at the beginning of a function, and give the name of the function. Takes effect only if GLOW_OPTION_DEBUG is defined.

GLOW_DEBUGSIGNAL(signal)

Causes GLOW to catch the given signal. If such a signal is thrown, GLOW will print out the signal number and the call stack, and abort. This statement should be located at the beginning of main(). Takes effect only if GLOW_OPTION_DEBUG is defined.

Back to
Table of contents


The GLOW Toolkit