SymInit: Symbol-SearchPath: '.;D:\ist3mp\1.3\bin;D:\ist3mp\1.3\bin;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'serg'OS-Version: 5.1.2600 (Service Pack 2) 0x100-0x1d:\ist3mp\1.3\isa3mp_src\processing\proc\unitrc_in_e\unitrc_in_e.cpp (1494): ProcUniTrcInput::modeFeedbackd:\ist3mp\1.3\isa3mp_src\processing\proc\unitrc_in_e\unitrc_in_e.cpp (108): ProcUniTrcInput::rund:\ist3mp\1.3\isa3mp_src\shared\src\procbase\jfm.cpp (1129): ThreadJ::runc:\qt\3.3.4\src\kernel\qthread_win.cpp (111): QThreadInstance::startf:\vs70builds\3077\vc\crtbld\crt\src\threadex.c (241): _threadstartexERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 7C80B50B)7C80B50B (kernel32): (filename not available): GetModuleFileNameA
#ifdef UNICODE #undef UNICODE#endif
/********************************************************************** * * StackWalker.cpp * * * History: * 2005-07-27 v1 - First public release on http://www.codeproject.com/ * http://www.codeproject.com/threads/StackWalker.asp * 2005-07-28 v2 - Changed the params of the constructor and ShowCallstack * (to simplify the usage) * 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL * (should also be enough) * - Changed to compile correctly with the PSDK of VC7.0 * (GetFileVersionInfoSizeA and GetFileVersionInfoA is wrongly defined: * it uses LPSTR instead of LPCSTR as first paremeter) * - Added declarations to support VC5/6 without using 'dbghelp.h' * - Added a 'pUserData' member to the ShowCallstack function and the * PReadProcessMemoryRoutine declaration (to pass some user-defined data, * which can be used in the readMemoryFunction-callback) * 2005-08-02 v4 - OnSymInit now also outputs the OS-Version by default * - Added example for doing an exception-callstack-walking in main.cpp * (thanks to owillebo: http://www.codeproject.com/script/profile/whos_who.asp?id=536268) * 2005-08-05 v5 - Removed most Lint (http://www.gimpel.com/) errors... thanks to Okko Willeboordse! * **********************************************************************/#ifdef UNICODE #undef UNICODE#endif#include <windows.h>#include <tchar.h>#include <stdio.h>#pragma comment(lib, "version.lib") // for "VerQueryValue"#include "StackWalker.h"
#include <stackwalker.h>class IstStackWalker : public StackWalker{public: IstStackWalker() : StackWalker( OptionsAll ^ RetrieveModuleInfo) {} virtual void OnOutput(LPCSTR szText) { QString s(szText); stackStr += QString(s); StackWalker::OnOutput(szText); } QString callstack() const { return stackStr; }private: QString stackStr;};
//Рисуем стэк вызовов в файл crashinfo.txtLONG WINAPI ExceptFilter(EXCEPTION_POINTERS* pExp){ IstStackWalker sw; sw.ShowCallstack(GetCurrentThread(), pExp->ContextRecord); QString stackReport = sw.callstack(); QFile file( "crash_report.txt" ); if ( file.open(IO_WriteOnly) ) { QTextStream os(&file); os << stackReport; file.close(); } } return EXCEPTION_EXECUTE_HANDLER;}
SetUnhandledExceptionFilter(ExceptFilter);