diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-23 12:37:53 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-23 12:37:53 +0100 |
commit | 4455a1643dab180c7ddc3bcce7ccae6763137dae (patch) | |
tree | b49e549e9318c2db351ac06318ab81477f97d131 | |
parent | Rewritten ore generation from scratch, using a different (much faster) algorithm. Chunk generation now about 2x faster :) (diff) | |
download | cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar.gz cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar.bz2 cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar.lz cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar.xz cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.tar.zst cuberite-4455a1643dab180c7ddc3bcce7ccae6763137dae.zip |
-rw-r--r-- | source/main.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/main.cpp b/source/main.cpp index c84980853..f19a88210 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -73,7 +73,7 @@ pMiniDumpWriteDump g_WriteMiniDump; // The function in dbghlp DLL that creates char g_DumpFileName[MAX_PATH]; // Filename of the dump file; hes to be created before the dump handler kicks in
char g_ExceptionStack[128 * 1024]; // Substitute stack, just in case the handler kicks in because of "insufficient stack space"
-MINIDUMP_TYPE DumpFlags = MiniDumpNormal; // By default dump only the stack and some helpers
+MINIDUMP_TYPE g_DumpFlags = MiniDumpNormal; // By default dump only the stack and some helpers
@@ -102,7 +102,7 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except // Write the dump file:
HANDLE dumpFile = CreateFile(g_DumpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- g_WriteMiniDump(GetCurrentProcess(), GetCurrentProcessId(), dumpFile, DumpFlags, (a_ExceptionInfo) ? &ExcInformation : NULL, NULL, NULL);
+ g_WriteMiniDump(GetCurrentProcess(), GetCurrentProcessId(), dumpFile, g_DumpFlags, (a_ExceptionInfo) ? &ExcInformation : NULL, NULL, NULL);
CloseHandle(dumpFile);
// Revert to old stack:
@@ -139,6 +139,21 @@ int main( int argc, char **argv ) {
_snprintf_s(g_DumpFileName, ARRAYCOUNT(g_DumpFileName), _TRUNCATE, "crash_mcs_%x.dmp", GetCurrentProcessId());
SetUnhandledExceptionFilter(LastChanceExceptionFilter);
+
+ // Parse arguments for minidump flags:
+ for (int i = 0; i < argc; i++)
+ {
+ if (stricmp(argv[i], "/cdg") == 0)
+ {
+ // Add globals to the dump
+ g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithDataSegs);
+ }
+ else if (stricmp(argv[i], "/cdf") == 0)
+ {
+ // Add full memory to the dump (HUUUGE file)
+ g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithFullMemory);
+ }
+ } // for i - argv[]
}
#endif // _WIN32 && !_WIN64
// End of dump-file magic
|