Remove unhandled exception catcher

This commit is contained in:
Vinnie Falco
2013-10-01 12:00:53 -07:00
parent 2aa5c74c2a
commit 2ac2fdfabd
12 changed files with 4 additions and 69 deletions

View File

@@ -52,8 +52,6 @@ David Features:
down the cache and then something that uses the cache, objects may get down the cache and then something that uses the cache, objects may get
put in the cache after it was shut down. put in the cache after it was shut down.
- Figure out the right behavior of ProtectedCall
- Do something about the throw() reporting weaknesses: - Do something about the throw() reporting weaknesses:
* Make sure all Sconstruct and .pro builds have debug symbols in release * Make sure all Sconstruct and .pro builds have debug symbols in release
* Replace all throw with beast::Throw() * Replace all throw with beast::Throw()

View File

@@ -75,16 +75,6 @@
//#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1 //#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
#endif #endif
/** Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS
This will wrap thread entry points with an exception catching block.
A customizable hook is provided to get called when unhandled exceptions
are thrown.
@see ProtectedCall
*/
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// //
// Libraries // Libraries

View File

@@ -235,7 +235,6 @@
<ClInclude Include="..\..\modules\beast_core\containers\DynamicList.h" /> <ClInclude Include="..\..\modules\beast_core\containers\DynamicList.h" />
<ClInclude Include="..\..\modules\beast_core\containers\Variant.h" /> <ClInclude Include="..\..\modules\beast_core\containers\Variant.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h" /> <ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\ProtectedCall.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\FPUFlags.h" /> <ClInclude Include="..\..\modules\beast_core\diagnostic\FPUFlags.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\LeakChecked.h" /> <ClInclude Include="..\..\modules\beast_core\diagnostic\LeakChecked.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\SemanticVersion.h" /> <ClInclude Include="..\..\modules\beast_core\diagnostic\SemanticVersion.h" />
@@ -730,12 +729,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\ProtectedCall.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\FPUFlags.cpp"> <ClCompile Include="..\..\modules\beast_core\diagnostic\FPUFlags.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>

View File

@@ -998,9 +998,6 @@
<ClInclude Include="..\..\modules\beast_core\misc\Main.h"> <ClInclude Include="..\..\modules\beast_core\misc\Main.h">
<Filter>beast_core\misc</Filter> <Filter>beast_core\misc</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\ProtectedCall.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h"> <ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h">
<Filter>beast_core\diagnostic</Filter> <Filter>beast_core\diagnostic</Filter>
</ClInclude> </ClInclude>
@@ -1730,9 +1727,6 @@
<ClCompile Include="..\..\modules\beast_core\misc\Main.cpp"> <ClCompile Include="..\..\modules\beast_core\misc\Main.cpp">
<Filter>beast_core\misc</Filter> <Filter>beast_core\misc</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\ProtectedCall.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\FatalError.cpp"> <ClCompile Include="..\..\modules\beast_core\diagnostic\FatalError.cpp">
<Filter>beast_core\diagnostic</Filter> <Filter>beast_core\diagnostic</Filter>
</ClCompile> </ClCompile>

View File

@@ -55,10 +55,6 @@
# endif # endif
#endif #endif
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 0
#endif
#if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS) #if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS)
#define BEAST_CHECK_MEMORY_LEAKS 1 #define BEAST_CHECK_MEMORY_LEAKS 1
#endif #endif

View File

@@ -329,15 +329,6 @@ public:
#endif #endif
} }
static int beastCatchExceptions ()
{
#ifdef BEAST_CATCH_UNHANDLED_EXCEPTIONS
return BEAST_CATCH_UNHANDLED_EXCEPTIONS;
#else
return 0;
#endif
}
void runTest () void runTest ()
{ {
beginTestCase ("diagnostics"); beginTestCase ("diagnostics");
@@ -346,7 +337,6 @@ public:
logMessage ("_DEBUG = " + String::fromNumber (envDebug ())); logMessage ("_DEBUG = " + String::fromNumber (envDebug ()));
logMessage ("BEAST_DEBUG = " + String::fromNumber (beastDebug ())); logMessage ("BEAST_DEBUG = " + String::fromNumber (beastDebug ()));
logMessage ("BEAST_FORCE_DEBUG = " + String::fromNumber (beastForceDebug ())); logMessage ("BEAST_FORCE_DEBUG = " + String::fromNumber (beastForceDebug ()));
logMessage ("BEAST_CATCH_UNHANDLED_EXCEPTIONS = " + String::fromNumber (beastCatchExceptions ()));
logMessage ("sizeof(std::size_t) = " + String::fromNumber (sizeof(std::size_t))); logMessage ("sizeof(std::size_t) = " + String::fromNumber (sizeof(std::size_t)));
bassertfalse; bassertfalse;

View File

@@ -74,16 +74,6 @@
//#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1 //#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
#endif #endif
/** Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS
This will wrap thread entry points with an exception catching block.
A customizable hook is provided to get called when unhandled exceptions
are thrown.
@see ProtectedCall
*/
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// //
// Libraries // Libraries

View File

@@ -141,7 +141,6 @@ namespace beast
#include "diagnostic/FatalError.cpp" #include "diagnostic/FatalError.cpp"
#include "diagnostic/FPUFlags.cpp" #include "diagnostic/FPUFlags.cpp"
#include "diagnostic/LeakChecked.cpp" #include "diagnostic/LeakChecked.cpp"
#include "diagnostic/ProtectedCall.cpp"
#include "diagnostic/SemanticVersion.cpp" #include "diagnostic/SemanticVersion.cpp"
#include "diagnostic/UnitTest.cpp" #include "diagnostic/UnitTest.cpp"
#include "diagnostic/UnitTestUtilities.cpp" #include "diagnostic/UnitTestUtilities.cpp"

View File

@@ -163,7 +163,6 @@ class FileOutputStream;
#include "memory/SharedObject.h" #include "memory/SharedObject.h"
#include "memory/SharedPtr.h" #include "memory/SharedPtr.h"
#include "memory/SharedFunction.h" #include "memory/SharedFunction.h"
#include "diagnostic/ProtectedCall.h"
#include "containers/AbstractFifo.h" #include "containers/AbstractFifo.h"
#include "text/Identifier.h" #include "text/Identifier.h"
#include "containers/Variant.h" #include "containers/Variant.h"

View File

@@ -99,7 +99,7 @@ void Thread::threadEntryPoint()
// used to wrap the incoming call from the platform-specific code // used to wrap the incoming call from the platform-specific code
void BEAST_API beast_threadEntryPoint (void* userData) void BEAST_API beast_threadEntryPoint (void* userData)
{ {
ProtectedCall (&Thread::threadEntryPoint, static_cast <Thread*> (userData)); static_cast <Thread*> (userData)->threadEntryPoint();
} }
//============================================================================== //==============================================================================

View File

@@ -17,29 +17,16 @@
*/ */
//============================================================================== //==============================================================================
namespace po = boost::program_options;
RippleMain::RippleMain() RippleMain::RippleMain()
{ {
ProtectedCall::setHandler (*this);
} }
RippleMain::~RippleMain() RippleMain::~RippleMain()
{ {
} }
void RippleMain::onException (ProtectedCall::Exception const& e) const
{
#if BEAST_MSVC
ExitProcess(0);
#else
_Exit(EXIT_FAILURE);
#endif
}
//------------------------------------------------------------------------------
namespace po = boost::program_options;
void setupServer () void setupServer ()
{ {
#ifdef RLIMIT_NOFILE #ifdef RLIMIT_NOFILE

View File

@@ -21,13 +21,12 @@
#ifndef RIPPLE_RIPPLEMAIN_H_INCLUDED #ifndef RIPPLE_RIPPLEMAIN_H_INCLUDED
#define RIPPLE_RIPPLEMAIN_H_INCLUDED #define RIPPLE_RIPPLEMAIN_H_INCLUDED
class RippleMain : public Main, public ProtectedCall::Handler class RippleMain : public Main
{ {
public: public:
RippleMain (); RippleMain ();
~RippleMain (); ~RippleMain ();
void onException (ProtectedCall::Exception const& e) const;
int run (int argc, char const* const* argv); int run (int argc, char const* const* argv);
}; };