Commit b0b13fa8 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

CrashHandler is now functionnal under Win32

parent e63aaf3b
......@@ -21,26 +21,33 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "CrashHandler.h"
#include "ui_CrashHandler.h"
#ifndef WIN32
#include <execinfo.h>
#endif
#include <execinfo.h>
#include <signal.h>
#include "CrashHandler.h"
#include "ui_CrashHandler.h"
CrashHandler::CrashHandler( int sig, QWidget *parent ) :
QDialog( parent ),
ui( new Ui::CrashHandler )
{
ui->setupUi( this );
#ifndef WIN32
void *buff[CrashHandler::backtraceSize];
int nbSymb = backtrace( buff, CrashHandler::backtraceSize );
char** backtraceStr = backtrace_symbols( buff, nbSymb );
for ( int i = 0; i < nbSymb; ++i )
ui->backtraceDisplay->insertPlainText( QString( backtraceStr[i]) + "\n" );
free(backtraceStr);
#else
ui->backtraceDisplay->insertPlainText( tr( "Unable to get backtrace." ) );
#endif
QString sigName = tr( "Unknown signal" );
if ( sig == SIGSEGV )
sigName = "SIGSEGV (Segmentation Fault)";
......
......@@ -59,6 +59,8 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
// signal( SIGSEGV, ProjectManager::signalHandler );
// signal( SIGINT, SIG_IGN );
signal( SIGFPE, ProjectManager::signalHandler );
signal( SIGABRT, ProjectManager::signalHandler );
signal( SIGILL, ProjectManager::signalHandler );
}
ProjectManager::~ProjectManager()
......
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