Browse Source

Added a parameter to SystemStats::CrashHandlerFunction to supply some platform-specific crash details

tags/2021-05-28
jules 8 years ago
parent
commit
5c4553a06c
2 changed files with 8 additions and 6 deletions
  1. +4
    -4
      modules/juce_core/system/juce_SystemStats.cpp
  2. +4
    -2
      modules/juce_core/system/juce_SystemStats.h

+ 4
- 4
modules/juce_core/system/juce_SystemStats.cpp View File

@@ -155,15 +155,15 @@ String SystemStats::getStackBacktrace()
static SystemStats::CrashHandlerFunction globalCrashHandler = nullptr;
#if JUCE_WINDOWS
static LONG WINAPI handleCrash (LPEXCEPTION_POINTERS)
static LONG WINAPI handleCrash (LPEXCEPTION_POINTERS ep)
{
globalCrashHandler();
globalCrashHandler (ep);
return EXCEPTION_EXECUTE_HANDLER;
}
#else
static void handleCrash (int)
static void handleCrash (int signum)
{
globalCrashHandler();
globalCrashHandler ((void*) (pointer_sized_int) signum);
kill (getpid(), SIGKILL);
}


+ 4
- 2
modules/juce_core/system/juce_SystemStats.h View File

@@ -192,8 +192,10 @@ public:
*/
static String getStackBacktrace();
/** A void() function type, used by setApplicationCrashHandler(). */
typedef void (*CrashHandlerFunction)();
/** A function type for use in setApplicationCrashHandler(). The parameter will contain
platform-specific data about the crash.
*/
typedef void (*CrashHandlerFunction) (void*);
/** Sets up a global callback function that will be called if the application
executes some kind of illegal instruction.


Loading…
Cancel
Save