diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index c7667acc2..3f0c26f69 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -83,7 +83,8 @@ using namespace std; #define LOG_IN_FILE NEL_LOG_IN_FILE // If true, debug system will trap crash even if the application is in debugger -static const bool TrapCrashInDebugger = false; +//static const bool TrapCrashInDebugger = false; +static const bool TrapCrashInDebugger = true; #ifdef DEBUG_NEW #define new DEBUG_NEW diff --git a/code/nel/src/misc/report.cpp b/code/nel/src/misc/report.cpp index 20b2b1c11..d761373fd 100644 --- a/code/nel/src/misc/report.cpp +++ b/code/nel/src/misc/report.cpp @@ -92,6 +92,36 @@ static bool CanSendMailReport= false; static bool DebugDefaultBehavior, QuitDefaultBehavior; +static void doSendReport() +{ + std::string filename; + + // Unfortunately Qt 4.8.5 on Windows messes up arguments. + // As a workaround the report filename is hardcoded for now. + // + //filename = "report_"; + //filename += NLMISC::toString( time( NULL ) ); + //filename += ".txt"; + + filename = "rcerrorlog.txt"; + + std::ofstream f; + f.open( filename.c_str() ); + if( !f.good() ) + return; + + f << Body; + + f.close(); + +#ifdef NL_OS_WINDOWS + NLMISC::launchProgram( "rcerror.exe", filename ); +#else + NLMISC::launchProgram( "rcerror", filename ); +#endif + +} + static void sendEmail() { if (CanSendMailReport && SendMessage(sendReport, BM_GETCHECK, 0, 0) != BST_CHECKED) @@ -133,7 +163,7 @@ static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM } else if ((HWND) lParam == debug) { - sendEmail(); + doSendReport(); NeedExit = true; Result = ReportDebug; if (DebugDefaultBehavior) @@ -143,13 +173,13 @@ static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM } else if ((HWND) lParam == ignore) { - sendEmail(); + doSendReport(); NeedExit = true; Result = ReportIgnore; } else if ((HWND) lParam == quit) { - sendEmail(); + doSendReport(); NeedExit = true; Result = ReportQuit; @@ -191,7 +221,7 @@ static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM if (wParam == 27) { // ESC -> ignore - sendEmail(); + doSendReport(); NeedExit = true; Result = ReportIgnore; }