17 #ifdef DtUSE_UTILITIES_NAMESPACE
18 #define DtMiniDumper Dt##MAKRti##MiniDumper
24 #define DECLSPEC_DEPRECATED
26 #include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h"
35 typedef BOOL(WINAPI* MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType,
36 CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
37 CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam);
53 const char* szAppName,
bool promptUser =
true,
const char* svnRev =
nullptr,
bool skipRichCallStack =
false);
55 static bool isPdbInCurrentWorkinDirectory(
const std::string& module);
60 static std::string backTrace(
int skip = 0,
int maxDepth = 100);
65 static LONG WINAPI TopLevelFilter(
struct _EXCEPTION_POINTERS* pExceptionInfo);
70 static LONG WINAPI VectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo);
74 static BOOL CALLBACK TopLevelFilterCallback(
75 PVOID pParam,
const PMINIDUMP_CALLBACK_INPUT pInput, PMINIDUMP_CALLBACK_OUTPUT pOutput);
80 MINIDUMP_TINY = MiniDumpNormal,
81 MINIDUMP_MINI = (MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory | MiniDumpWithModuleHeaders |
82 MiniDumpWithDataSegs),
83 MINIDUMP_MIDI = (MiniDumpWithPrivateReadWriteMemory | MiniDumpWithDataSegs | MiniDumpWithHandleData |
84 MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules),
85 MINIDUMP_MAX = (MiniDumpWithFullMemory | MiniDumpWithFullMemoryInfo | MiniDumpWithHandleData |
86 MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules)
90 static char* m_szAppName;
92 static bool myDisableHandler;
93 static DtMiniDumper::DtMiniDumpType myMiniDumpType;
94 #ifdef DtUSE_UTILITIES_NAMESPACE
95 static DtUSE_UTILITIES_NAMESPACE::DtMutex theMutex;
104 #define DtINIT_MINIDUMPER(execName) DtMiniDumper miniDump(execName, true, SVN_REV);
105 #define DtINIT_MINIDUMPER_NO_PROMPT(execName) DtMiniDumper miniDump(execName, false, SVN_REV);
107 #define DtINIT_MINIDUMPER(execName) DtMiniDumper miniDump(execName);
108 #define DtINIT_MINIDUMPER_NO_PROMPT(execName) DtMiniDumper miniDump(execName, false);
111 #define DtSILENTLY_CRASH(unused) \
113 ::SetUnhandledExceptionFilter(0); \
114 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); \
122 #include <execinfo.h>
123 #include <ucontext.h>
149 const char* szAppName,
bool promptUser =
true,
const char* svnRev =
nullptr,
bool skipRichCallStack =
false);
152 static void printCallStack(
int sig, siginfo_t* info,
void* secret);
159 static std::string backTrace(
int skip = 0,
int maxDepth = 100,
const void* crashAddress =
nullptr);
166 static void initializeAddressSpace();
169 static void objFileAndNameFromStack(
char* stackEntry, std::string& objFile, std::string& objFileName);
172 static std::string lookupFileInfo(
const std::string& objFile,
unsigned long offset);
177 static void appendAddr2LineDetail(std::ostream& strm);
197 static char myCallstackLogPath[4096];
205 #define DtINIT_MINIDUMPER(execName) DtMiniDumper miniDump(execName, true, SVN_REV);
206 #define DtINIT_MINIDUMPER_NO_PROMPT(execName) DtMiniDumper miniDump(execName, false, SVN_REV);
209 #define DtINIT_MINIDUMPER_RAW_ONLY(execName) DtMiniDumper miniDump(execName, false, SVN_REV, true);
211 #define DtINIT_MINIDUMPER(execName) DtMiniDumper miniDump(execName);
212 #define DtINIT_MINIDUMPER_NO_PROMPT(execName) DtMiniDumper miniDump(execName, false);
215 #define DtINIT_MINIDUMPER_RAW_ONLY(execName) DtMiniDumper miniDump(execName, false, nullptr, true);
218 #define DtSILENTLY_CRASH(unused) \
This file contains the declaration of DtMutex.
std::map< std::string, unsigned long > AddressSpaceMap
Definition: vlMiniDumper.h:181
void(* SigActionCb)(int, siginfo_t *, void *)
Definition: vlMiniDumper.h:201
static bool mySkipRichCallStack
When true, printCallStack skips the non-async-signal-safe boost::stacktrace/addr2line pass and leaves...
Definition: vlMiniDumper.h:190
This class contains the logic necesary for printing a stack trace.
Definition: vlMiniDumper.h:132
instances of DtMutex are used to provide a platform independent mutual exclusion mechanism ...
Definition: vlMutex.h:31
static AddressSpaceMap myAddressSpaceMap
Maps loaded object file names to base addresses in memory.
Definition: vlMiniDumper.h:184
static std::string myApplicationName
Definition: vlMiniDumper.h:161
This file contains typedefs for machine dependant types.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:121