@@ -53,8 +53,6 @@ static BOOL bException = FALSE;
53
53
54
54
#ifdef DEBUG
55
55
#define USE_OWN_ERROR_MESSAGE_WINDOW
56
- #else
57
- #define USE_OWN_MINI_DUMP
58
56
#endif
59
57
60
58
#if defined XR_X64
@@ -618,11 +616,14 @@ void WINAPI xrDebug::PreErrorHandler(INT_PTR)
618
616
void xrDebug::SetupExceptionHandler (const bool & dedicated)
619
617
{
620
618
#if defined(WINDOWS)
619
+ const auto commandLine = GetCommandLine ();
620
+
621
621
// disable 'appname has stopped working' popup dialog
622
- UINT prevMode = SetErrorMode (SEM_NOGPFAULTERRORBOX);
622
+ const auto prevMode = SetErrorMode (SEM_NOGPFAULTERRORBOX);
623
623
SetErrorMode (prevMode | SEM_NOGPFAULTERRORBOX);
624
624
BT_InstallSehFilter ();
625
- if (!dedicated && !strstr (GetCommandLine (), " -silent_error_mode" ))
625
+
626
+ if (!dedicated && !strstr (commandLine, " -silent_error_mode" ))
626
627
BT_SetActivityType (BTA_SHOWUI);
627
628
else
628
629
BT_SetActivityType (BTA_SAVEREPORT);
@@ -636,50 +637,23 @@ void xrDebug::SetupExceptionHandler(const bool& dedicated)
636
637
BT_SetAppName (" X-Ray Engine" );
637
638
BT_SetReportFormat (BTRF_TEXT);
638
639
BT_SetFlags (BTF_DETAILEDMODE | BTF_ATTACHREPORT);
640
+
639
641
#ifdef MASTER_GOLD
640
- #ifdef _EDITOR // MASTER_GOLD && EDITOR
641
- auto minidumpFlags = !dedicated ? MiniDumpNoDump : MiniDumpWithDataSegs;
642
- #else // MASTER_GOLD && !EDITOR
643
- auto minidumpFlags = !dedicated ? MiniDumpNoDump : MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory;
644
- #endif
642
+ auto minidumpFlags = MiniDumpFilterMemory | MiniDumpScanMemory;
643
+
644
+ if (strstr (commandLine, " -detailed_minidump" ))
645
+ minidumpFlags = MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory;
645
646
#else
646
- #ifdef EDITOR // !MASTER_GOLD && EDITOR
647
- auto minidumpFlags = MiniDumpWithDataSegs;
648
- #else // !MASTER_GOLD && !EDITOR
649
- auto minidumpFlags = MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory;
650
- #endif
647
+ const auto minidumpFlags = MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory;
651
648
#endif
649
+
652
650
BT_SetDumpType (minidumpFlags);
653
651
// BT_SetSupportEMail("[email protected] ");
654
652
BT_SetSupportEMail (
" [email protected] " );
655
653
#endif
656
654
}
657
655
#endif // USE_BUG_TRAP
658
656
659
- #ifdef USE_OWN_MINI_DUMP
660
- void xrDebug::SaveMiniDump (EXCEPTION_POINTERS *exPtrs)
661
- {
662
- #if defined(WINDOWS)
663
- string64 dateStr;
664
- timestamp (dateStr);
665
- string_path dumpPath;
666
- xr_sprintf (dumpPath, sizeof (dumpPath), " %s_%s_%s.mdmp" , Core.ApplicationName , Core.UserName , dateStr);
667
- __try
668
- {
669
- if (FS.path_exist (" $logs$" ))
670
- FS.update_path (dumpPath, " $logs$" , dumpPath);
671
- }
672
- __except (EXCEPTION_EXECUTE_HANDLER)
673
- {
674
- string_path temp;
675
- xr_strcpy (temp, dumpPath);
676
- xr_sprintf (dumpPath, sizeof (dumpPath), " logs/%s" , temp);
677
- }
678
- WriteMiniDump (MINIDUMP_TYPE (MiniDumpFilterMemory | MiniDumpScanMemory), dumpPath, GetCurrentThreadId (), exPtrs);
679
- #endif
680
- }
681
- #endif
682
-
683
657
void xrDebug::FormatLastError (char * buffer, const size_t & bufferSize)
684
658
{
685
659
#if defined(WINDOWS)
0 commit comments