TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
debugAssert.h File Reference
#include <string>
#include "G3D/platform.h"
#include <cstdlib>
+ Include dependency graph for debugAssert.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 G3D
 
 G3D::_internal
 

Macros

#define __debugPromptShowDialog__   true
 
#define rawBreak()   do {} while (0)
 
#define debugAssert(exp)   do {} while (0)
 
#define debugAssertM(exp, message)   do {} while (0)
 
#define debugBreak()   do {} while (0)
 
#define alwaysAssertM(exp, message)
 

Typedefs

typedef bool(* G3D::AssertionHook )(const char *_expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)
 

Functions

void G3D::setAssertionHook (AssertionHook hook)
 
AssertionHook G3D::assertionHook ()
 
void G3D::setFailureHook (AssertionHook hook)
 
AssertionHook G3D::failureHook ()
 
bool G3D::_internal::_handleDebugAssert_ (const char *expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)
 
bool G3D::_internal::_handleErrorCheck_ (const char *expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)
 
void G3D::_internal::_releaseInputGrab_ ()
 
void G3D::_internal::_restoreInputGrab_ ()
 

Variables

AssertionHook G3D::_internal::_debugHook = _handleDebugAssert_
 
AssertionHook G3D::_internal::_failureHook = _handleErrorCheck_
 

Detailed Description

debugAssert(expression); debugAssertM(expression, message);

[John] Robbins, Microsoft Systems Journal Bugslayer Column, Feb 1999. http://msdn.microsoft.com/library/periodic/period99/feb99_BUGSLAYE_BUGSLAYE.htm

[Douglas] Cox, An assert() Replacement, Code of The Day, flipcode, Sept 19, 2000 http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-AssertReplace&forum=cotd&id=-1

Morgan McGuire, http://graphics.cs.williams.edu

2001-08-26 2006-01-12

Copyright 2000-2006, Morgan McGuire. All rights reserved.

Macro Definition Documentation

#define __debugPromptShowDialog__   true
#define alwaysAssertM (   exp,
  message 
)
Value:
{ \
if (!(exp)) { \
G3D::_internal::_failureHook(#exp, message, __FILE__, __LINE__, __debugPromptShowDialog__)) { \
::exit(-1); \
} \
} \
}
Quat exp(const Quat &q)
Definition: Quat.h:729
#define __debugPromptShowDialog__
Definition: debugAssert.h:155
arena_t NULL
Definition: jemalloc_internal.h:624
AssertionHook _failureHook
Definition: debugAssert.cpp:37
void _restoreInputGrab_()
Definition: debugAssert.cpp:279
void _releaseInputGrab_()
Definition: debugAssert.cpp:233

Same as debugAssertM except that it asserts in release builds as well.

#define debugAssert (   exp)    do {} while (0)

Breaks if the expression is false. If G3D_DEBUG_NOGUI is defined, prompts at the console, otherwise pops up a dialog. The user may then break (debug), ignore, or halt the program.

The assertion is also posted to the clipboard under Win32.

#define debugAssertM (   exp,
  message 
)    do {} while (0)

Breaks if the expression is false and displays a message. If G3D_DEBUG_NOGUI is defined, prompts at the console, otherwise pops up a dialog. The user may then break (debug), ignore, or halt the program.

The assertion is also posted to the clipboard under Win32.

#define debugBreak ( )    do {} while (0)

Break at the current location (i.e. don't push a procedure stack frame before breaking).

#define rawBreak ( )    do {} while (0)