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,
36 MINIDUMP_TYPE DumpType, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
37 CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
38 CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam );
50 DtMiniDumper(
const char* szAppName,
bool promptUser =
true );
52 static bool isPdbInCurrentWorkinDirectory(
const std::string& module);
53 static std::string backTrace();
58 static LONG WINAPI TopLevelFilter(
struct _EXCEPTION_POINTERS* pExceptionInfo );
62 static LONG WINAPI VectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo);
66 static BOOL CALLBACK TopLevelFilterCallback(PVOID pParam,
const PMINIDUMP_CALLBACK_INPUT pInput, PMINIDUMP_CALLBACK_OUTPUT pOutput);
71 MINIDUMP_TINY = MiniDumpNormal,
72 MINIDUMP_MINI = (MiniDumpWithIndirectlyReferencedMemory |
74 MINIDUMP_MIDI = (MiniDumpWithPrivateReadWriteMemory |
75 MiniDumpWithDataSegs |
76 MiniDumpWithHandleData |
77 MiniDumpWithFullMemoryInfo |
78 MiniDumpWithThreadInfo |
79 MiniDumpWithUnloadedModules),
80 MINIDUMP_MAX = (MiniDumpWithFullMemory |
81 MiniDumpWithFullMemoryInfo |
82 MiniDumpWithHandleData |
83 MiniDumpWithThreadInfo |
84 MiniDumpWithUnloadedModules)
88 static char* m_szAppName;
90 static bool myDisableHandler;
91 static DtMiniDumper::DtMiniDumpType myMiniDumpType;
92 #ifdef DtUSE_UTILITIES_NAMESPACE
93 static DtUSE_UTILITIES_NAMESPACE::DtMutex theMutex;
99 #define DtINIT_MINIDUMPER( execName ) DtMiniDumper miniDump( execName );
100 #define DtINIT_MINIDUMPER_NO_PROMPT( execName ) DtMiniDumper miniDump( execName, false );
102 #define DtSILENTLY_CRASH( unused ) \
104 ::SetUnhandledExceptionFilter(0); \
105 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); \
112 #include <execinfo.h>
113 #include <ucontext.h>
124 static void printCallStack(
int sig, siginfo_t* info,
void* secret );
130 static void initializeAddressSpace();
133 static void objFileAndNameFromStack(
char* stackEntry,
134 std::string& objFile, std::string& objFileName );
137 static std::string lookupFileInfo(
const std::string& objFile,
138 unsigned long offset );
157 #define DtINIT_MINIDUMPER( unused ) \
159 struct sigaction sa; \
160 sa.sa_sigaction = (SigActionCb) DtMiniDumper::printCallStack; \
161 sa.sa_flags = SA_SIGINFO; \
162 sigemptyset( &sa.sa_mask ); \
163 sigaction( SIGSEGV, &sa, 0 ); \
167 #define DtINIT_MINIDUMPER_NO_PROMPT( unused ) \
169 struct sigaction sa; \
170 sa.sa_sigaction = (SigActionCb) DtMiniDumper::printCallStack; \
171 sa.sa_flags = SA_SIGINFO; \
172 sigemptyset( &sa.sa_mask ); \
173 sigaction( SIGSEGV, &sa, 0 ); \
177 #define DtSILENTLY_CRASH( unused ) \
This file contains the declaration of DtMutex.
void(* SigActionCb)(int, siginfo_t *, void *)
Definition: vlMiniDumper.h:156
This class contains the logic necesary for printing a stack trace.
Definition: vlMiniDumper.h:119
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:151
std::map< std::string, unsigned long > AddressSpaceMap
Definition: vlMiniDumper.h:148
This file contains typedefs for machine dependant types.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109