本文整理汇总了C++中CCrashHandler::GenerateErrorReport方法的典型用法代码示例。如果您正苦于以下问题:C++ CCrashHandler::GenerateErrorReport方法的具体用法?C++ CCrashHandler::GenerateErrorReport怎么用?C++ CCrashHandler::GenerateErrorReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrashHandler
的用法示例。
在下文中一共展示了CCrashHandler::GenerateErrorReport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: crSetErrorMsg
crGenerateErrorReport(
CR_EXCEPTION_INFO* pExceptionInfo)
{
crSetErrorMsg(_T("Unspecified error."));
if(pExceptionInfo==NULL ||
pExceptionInfo->cb!=sizeof(CR_EXCEPTION_INFO))
{
crSetErrorMsg(_T("Exception info is NULL or invalid."));
return 1;
}
CCrashHandler *pCrashHandler =
CCrashHandler::GetCurrentProcessCrashHandler();
if(pCrashHandler==NULL)
{
// Handler is not installed for current process
crSetErrorMsg(_T("Crash handler wasn't previously installed for current process."));
ATLASSERT(pCrashHandler!=NULL);
return 2;
}
return pCrashHandler->GenerateErrorReport(pExceptionInfo);
}
示例2: cpp_invalid_parameter_handler
void __cdecl cpp_invalid_parameter_handler(
const wchar_t* expression,
const wchar_t* function,
const wchar_t* file,
unsigned int line,
uintptr_t pReserved)
{
pReserved;
// Invalid parameter exception
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_INVALID_PARAMETER;
ei.expression = expression;
ei.function = function;
ei.file = file;
ei.line = line;
pCrashHandler->GenerateErrorReport(&ei);
}
exit(1); // Terminate program
}
示例3: GenerateErrorReportEx
CRASHRPTAPI void GenerateErrorReportEx(LPVOID lpState, PEXCEPTION_POINTERS pExInfo, BSTR message)
{
CCrashHandler *pImpl = (CCrashHandler*)lpState;
CRASH_ASSERT(pImpl);
if (!pImpl->GenerateErrorReport(pExInfo, message)) {
DebugBreak();
}
}
示例4: SehHandler
// Structured exception handler
LONG WINAPI CCrashHandler::SehHandler(PEXCEPTION_POINTERS pExceptionPtrs)
{
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_SEH_EXCEPTION;
ei.pexcptrs = pExceptionPtrs;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例5: cpp_unexp_handler
void __cdecl cpp_unexp_handler()
{
// Unexpected error (unexpected() function was called)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_UNEXPECTED_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例6: SigintHandler
// CRT sigint signal handler
void CCrashHandler::SigintHandler(int)
{
// Interruption (SIGINT)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGINT;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例7: cpp_purecall_handler
void __cdecl cpp_purecall_handler()
{
// Pure virtual function call
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_PURE_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例8: cpp_terminate_handler
void __cdecl cpp_terminate_handler()
{
// Abnormal program termination (terminate() function was called)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_TERMINATE_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例9: SigabrtHandler
// CRT SIGABRT signal handler
void CCrashHandler::SigabrtHandler(int)
{
// Caught SIGABRT C++ signal
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGABRT;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
ExitProcess(1);
}
示例10: cpp_sigterm_handler
void cpp_sigterm_handler(int)
{
// Termination request (SIGTERM)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGTERM;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例11: cpp_new_handler
int __cdecl cpp_new_handler(size_t)
{
// 'new' operator memory allocation exception
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_NEW_OPERATOR_ERROR;
ei.pexcptrs = NULL;
pCrashHandler->GenerateErrorReport(&ei);
}
exit(1); // Terminate program
}
示例12: cpp_sigsegv_handler
void cpp_sigsegv_handler(int)
{
// Invalid storage access (SIGSEGV)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGSEGV;
ei.pexcptrs = (PEXCEPTION_POINTERS)_pxcptinfoptrs;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例13: ATLASSERT
LONG WINAPI Win32UnhandledExceptionFilter(PEXCEPTION_POINTERS pExceptionPtrs)
{
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_WIN32_STRUCTURED_EXCEPTION;
ei.pexcptrs = pExceptionPtrs;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
#if _MSC_VER<1300 // This is to make MSVC6.0 compiler happy
return EXCEPTION_EXECUTE_HANDLER;
#endif
}
示例14: cpp_sigfpe_handler
void cpp_sigfpe_handler(int /*code*/, int subcode)
{
// Floating point exception (SIGFPE)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGFPE;
ei.pexcptrs = (PEXCEPTION_POINTERS)_pxcptinfoptrs;
ei.fpe_subcode = subcode;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例15: cpp_security_handler
void __cdecl cpp_security_handler(int code, void *x)
{
// Security error (buffer overrun).
code;
x;
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SECURITY_ERROR;
pCrashHandler->GenerateErrorReport(&ei);
}
exit(1); // Terminate program
}