debug/crash: temporarily disable backtrace reporting

We're using breakpad for a few projects. It has much better
functionality.
This commit is contained in:
Danny Robson 2019-10-21 16:33:51 +11:00
parent a020f1d429
commit ffb7fde46f
3 changed files with 35 additions and 2 deletions

View File

@ -46,7 +46,8 @@ backtrace::backtrace (void)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
std::ostream& std::ostream&
debug::operator <<(std::ostream &os, ::cruft::backtrace const &rhs) { debug::operator <<(std::ostream &os, ::cruft::backtrace const &rhs)
{
static auto process = GetCurrentProcess (); static auto process = GetCurrentProcess ();
CHECK (ready); CHECK (ready);

View File

@ -53,6 +53,9 @@ void dumping_handler (int sig, siginfo_t *info, void *ucontext)
void void
cruft::debug::init_crash_handler () cruft::debug::init_crash_handler ()
{ {
// Keep this disabled for the time being as most projects we're using
// employ breakpad which has better functionality.
#if 0
struct sigaction new_handler {}; struct sigaction new_handler {};
memset (&new_handler, 0, sizeof (new_handler)); memset (&new_handler, 0, sizeof (new_handler));
new_handler.sa_flags = SA_SIGINFO; new_handler.sa_flags = SA_SIGINFO;
@ -67,4 +70,5 @@ cruft::debug::init_crash_handler ()
) )
); );
} }
#endif
} }

View File

@ -8,9 +8,37 @@
#include "crash.hpp" #include "crash.hpp"
#include "assert.hpp"
#include "../backtrace.hpp"
#include "../win32/windows.hpp"
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
static LPTOP_LEVEL_EXCEPTION_FILTER previous_handler;
///////////////////////////////////////////////////////////////////////////////
static LONG __stdcall
backtrace_handler (EXCEPTION_POINTERS *data)
{
std::clog << cruft::backtrace () << '\n';
if (previous_handler)
return previous_handler (data);
else
return EXCEPTION_CONTINUE_SEARCH;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void void
cruft::debug::init_crash_handler (void) cruft::debug::init_crash_handler (void)
{ {
#if 0
CHECK (!previous_handler);
previous_handler = SetUnhandledExceptionFilter (backtrace_handler);
#endif
} }