--------------------- PatchSet 7475 Date: 2008/03/17 20:22:48 Author: chtsanti Branch: async-calls Tag: (none) Log: undo the xThrow() related patch. This patch prevented code from using try/catch blocks outside of jobs that handle exceptions. Members: src/Debug.h:1.10.4.5->1.10.4.6 src/TextException.cc:1.1.38.2->1.1.38.3 src/TextException.h:1.1.38.2->1.1.38.3 src/debug.cc:1.18.4.6->1.18.4.7 Index: squid3/src/Debug.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Debug.h,v retrieving revision 1.10.4.5 retrieving revision 1.10.4.6 diff -u -r1.10.4.5 -r1.10.4.6 --- squid3/src/Debug.h 16 Mar 2008 15:43:15 -0000 1.10.4.5 +++ squid3/src/Debug.h 17 Mar 2008 20:22:48 -0000 1.10.4.6 @@ -1,5 +1,5 @@ /* - * $Id: Debug.h,v 1.10.4.5 2008/03/16 15:43:15 chtsanti Exp $ + * $Id: Debug.h,v 1.10.4.6 2008/03/17 20:22:48 chtsanti Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -56,7 +56,6 @@ void WontCatchException(); extern int TheSalvagedAsserts; extern int TheAssertsPerStep; -void xThrow(const char *message, const char *fileName, int lineNo); /* defined names for Debug Levels */ #define DBG_CRITICAL 0 /**< critical messages always shown when they occur */ Index: squid3/src/TextException.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/TextException.cc,v retrieving revision 1.1.38.2 retrieving revision 1.1.38.3 diff -u -r1.1.38.2 -r1.1.38.3 --- squid3/src/TextException.cc 16 Mar 2008 15:43:15 -0000 1.1.38.2 +++ squid3/src/TextException.cc 17 Mar 2008 20:22:48 -0000 1.1.38.3 @@ -10,9 +10,6 @@ xfree(message); } -#if 0 -// The old Throw function. Replaced by the xThrow function defined in debug.cc file - void Throw(const char *message, const char *fileName, int lineNo) { @@ -28,4 +25,3 @@ throw TextException(message, fileName, lineNo); } -#endif Index: squid3/src/TextException.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/TextException.h,v retrieving revision 1.1.38.2 retrieving revision 1.1.38.3 diff -u -r1.1.38.2 -r1.1.38.3 --- squid3/src/TextException.h 16 Mar 2008 15:43:15 -0000 1.1.38.2 +++ squid3/src/TextException.h 17 Mar 2008 20:22:48 -0000 1.1.38.3 @@ -34,14 +34,13 @@ # define TexcHere(msg) TextException((msg), __FILE__, __LINE__) #endif -//Throw function replaced by the xThrow function defined in debug.cc -//extern void Throw(const char *message, const char *fileName, int lineNo); +extern void Throw(const char *message, const char *fileName, int lineNo); // Must(condition) is like assert(condition) but throws an exception instead #if !defined(Must) # define Must(cond) ((cond) ? \ (void)0 : \ - (void)xThrow(#cond, __FILE__, __LINE__)) + (void)Throw(#cond, __FILE__, __LINE__)) #endif #endif /* SQUID__TEXTEXCEPTION_H */ Index: squid3/src/debug.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/debug.cc,v retrieving revision 1.18.4.6 retrieving revision 1.18.4.7 diff -u -r1.18.4.6 -r1.18.4.7 --- squid3/src/debug.cc 16 Mar 2008 15:43:15 -0000 1.18.4.6 +++ squid3/src/debug.cc 17 Mar 2008 20:22:48 -0000 1.18.4.7 @@ -1,5 +1,5 @@ /* - * $Id: debug.cc,v 1.18.4.6 2008/03/16 15:43:15 chtsanti Exp $ + * $Id: debug.cc,v 1.18.4.7 2008/03/17 20:22:48 chtsanti Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -620,29 +620,6 @@ abort(); } - -void xThrow(const char *message, const char *fileName, int lineNo){ - - if (AsyncCall_Handling_Exceptions) { - // or should we let the exception recepient print the exception instead? - - if (fileName) { - debugs(0, 3, fileName << ':' << lineNo << ": exception" << - (message ? ": " : ".") << (message ? message : "")); - } else { - debugs(0, 3, "exception" << - (message ? ": " : ".") << (message ? message : "")); - } - - throw TextException(message, fileName, lineNo); - } - - debugs(0, 0, "failed to handle exception:" << message << - "(" << fileName << ":" << lineNo << ")" ); - - abort(); -} - /* * Context-based Debugging *