Commit e159e8a7 authored by Charles Law's avatar Charles Law
Browse files

Break on error

parent c9eee8eb
......@@ -137,3 +137,13 @@ void vtkObject::SetDebug(int debugFlag)
this->Debug = debugFlag;
}
// Description:
// This method is called when vtkErrorMacro executes. It allows
// the debugger to break on error.
void vtkObject::BreakOnError()
{
}
......@@ -80,6 +80,8 @@ public:
virtual void PrintHeader(ostream& os, vtkIndent indent);
virtual void PrintTrailer(ostream& os, vtkIndent indent);
static void BreakOnError();
protected:
int Debug; // Enable debug messages
vtkTimeStamp MTime; // Keep track of modification time
......
......@@ -363,7 +363,7 @@ void Get##name (type data[count]) \
vtkmsgbuff = vtkmsg.str(); \
vtkmsgbuff[vtkmsg.pcount()] = '\0'; \
MessageBox(NULL,vtkmsgbuff,"Debug Info",MB_ICONERROR | MB_OK); \
delete vtkmsgbuff;}
delete vtkmsgbuff; vtkObject::BreakOnError();}
#else
//
......@@ -385,7 +385,7 @@ void Get##name (type data[count]) \
// vtkErrorMacro(<< "Error message" << variable);
//
#define vtkErrorMacro(x) \
cerr << "ERROR In " __FILE__ << ", line " << __LINE__ << "\n" << this->GetClassName() << " (" << this << "): " x << "\n\n"
{cerr << "ERROR In " __FILE__ << ", line " << __LINE__ << "\n" << this->GetClassName() << " (" << this << "): " x << "\n\n"; vtkObject::BreakOnError();}
#endif
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment