Files
OrcaSlicer/src/dev-utils/BaseException.h
Alves b0b7890c9e feature add sentry for catch crash on win (#50)
* feature add sentry for soft catch dmp

* feature add cli upload pdb to sentry server

* feature add flag for control sentry to use

* fix  flag not effect on src/makefile

* feature unzip for dmp file to upload sentry server

* feature remove test code

* feature add api for function report log to server

* feature update the soft version
2025-12-05 09:19:32 +08:00

29 lines
1.2 KiB
C++

#pragma once
#include <boost/nowide/cstdio.hpp>
#include <boost/nowide/fstream.hpp>
#include "stackwalker.h"
#include <eh.h>
class CBaseException : public CStackWalker
{
public:
CBaseException(HANDLE hProcess = GetCurrentProcess(), WORD wPID = GetCurrentProcessId(), LPCTSTR lpSymbolPath = NULL, PEXCEPTION_POINTERS pEp = NULL);
~CBaseException(void);
virtual void OutputString(LPCTSTR lpszFormat, ...);
virtual void ShowLoadModules();
virtual void ShowCallstack(HANDLE hThread = GetCurrentThread(), const CONTEXT* context = NULL);
virtual void ShowExceptionResoult(DWORD dwExceptionCode);
virtual BOOL GetLogicalAddress(PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD& offset );
virtual void ShowRegistorInformation(PCONTEXT pCtx);
virtual void ShowExceptionInformation();
static LONG WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo);
static LONG WINAPI UnhandledExceptionFilter2(PEXCEPTION_POINTERS pExceptionInfo);
static void STF(unsigned int ui, PEXCEPTION_POINTERS pEp);
//BBS set crash log folder
static void set_log_folder(std::string log_folder);
protected:
PEXCEPTION_POINTERS m_pEp;
boost::nowide::ofstream *output_file;
};
#define SET_DEFAUL_EXCEPTION() _set_se_translator(CBaseException::STF)