生成 pdb 文件转载自QT 生成pdb文件 - 七星落地 - 博客园 QMAKE_LFLAGS_RELEASE += /MAP
QMAKE_CFLAGS_RELEASE += /Zi
QMAKE_LFLAGS_RELEASE += /Debug /opt:ref
QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE += $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
#include
#include
#pragma comment(lib,"DbgHelp.lib")
long __stdcall _Crush_Callback(_EXCEPTION_POINTERS* ep)
{
HANDLE hFile = CreateFileA("Test.DMP",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if(hFile == INVALID_HANDLE_VALUE)
{
return EXCEPTION_CONTINUE_SEARCH;
}
MINIDUMP_EXCEPTION_INFORMATION exceptioninfo;
exceptioninfo.ExceptionPointers = ep;
exceptioninfo.ThreadId = GetCurrentThreadId();
exceptioninfo.ClientPointers = FALSE;
if(!MiniDumpWriteDump(GetCurrentProcess(),GetCurrentProcessId(),hFile,MiniDumpFilterMemory,&exceptioninfo,NULL,NULL))
{
return EXCEPTION_CONTINUE_SEARCH;
}
CloseHandle(hFile);
return EXCEPTION_EXECUTE_HANDLER;
}
SetUnhandledExceptionFilter(_Crush_Callback);