src/tool/error.h File Reference

#include <string>

Include dependency graph for error.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CError

Defines

#define assert(COND)   if (!(COND)) MissedAssertion (__FILE__, __LINE__, #COND);
#define FORCE_ASSERT(COND)   if (!(COND)) MissedAssertion (__FILE__, __LINE__, #COND);
#define Error(txt)   TriggerError(__FILE__, __LINE__, txt)

Functions

void MissedAssertion (const char *filename, unsigned long line, const char *message)
void WakeUpDebugger ()
void TriggerError (const char *filename, unsigned long line, const std::string &txt)


Define Documentation

#define assert ( COND   )     if (!(COND)) MissedAssertion (__FILE__, __LINE__, #COND);

Definition at line 37 of file error.h.

#define Error ( txt   )     TriggerError(__FILE__, __LINE__, txt)

Definition at line 47 of file error.h.

#define FORCE_ASSERT ( COND   )     if (!(COND)) MissedAssertion (__FILE__, __LINE__, #COND);

Definition at line 41 of file error.h.


Function Documentation

void MissedAssertion ( const char *  filename,
unsigned long  line,
const char *  message 
)

Definition at line 45 of file error.cpp.

00047 {
00048   std::cout << std::endl;
00049   std::cerr << filename << ':' << line 
00050             << ": Missed assertion \"" << message << "\"."
00051             << std::endl;
00052 #if defined DEBUG
00053   WakeUpDebugger();
00054   abort();
00055 #endif
00056 }

Here is the call graph for this function:

void TriggerError ( const char *  filename,
unsigned long  line,
const std::string &  txt 
)

Definition at line 77 of file error.cpp.

00079 {
00080   std::cout << "! " 
00081             << Format(_("Error in %s:%lu"), filename, line)
00082             << ": " << txt << std::endl;
00083 
00084   assert(false);
00085   throw CError (filename, line, txt);
00086 }

Here is the call graph for this function:

void WakeUpDebugger (  ) 

Definition at line 32 of file error.cpp.

00033 {
00034 
00035 #ifdef LOVE_HAYPO_HACKS
00036   // Generate SIGTRAP
00037   asm ("int $0x03");
00038 #endif
00039     
00040 #if !defined WIN32
00041   kill (getpid(), SIGABRT);
00042 #endif
00043 }

Here is the caller graph for this function:


Generated on Mon Jan 1 13:25:32 2007 for Wormux by  doxygen 1.4.7