/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/System/StackTracer.h
33 строки
1 KB
Jan Krassnigg
Use precompiled tools, if a tool is not available anywhere else
16 мар 2023, 12:22
16 мар 2023, 12:22
3fa1b36
Код
Авторство
О чём код?
#pragma once #include <Foundation/Basics.h> #include <Foundation/Configuration/Plugin.h> #include <Foundation/Types/Delegate.h> /// \brief Helper class to capture the current stack and print a captured stack class EZ_FOUNDATION_DLL ezStackTracer { public: /// \brief Captures the current stack trace. /// /// The trace will contain not more than ref_trace.GetCount() entries. /// [Windows] If called in an exception handler, set pContext to PEXCEPTION_POINTERS::ContextRecord. /// Returns the actual number of captured entries. static ezUInt32 GetStackTrace(ezArrayPtr<void*>& ref_trace, void* pContext = nullptr); /// \brief Callback-function to print a text somewhere using PrintFunc = ezDelegate<void(const char* szText)>; /// \brief Print a stack trace static void ResolveStackTrace(const ezArrayPtr<void*>& trace, PrintFunc printFunc); /// \brief Print a stack trace without resolving it static void PrintStackTrace(const ezArrayPtr<void*>& trace, PrintFunc printFunc); private: ezStackTracer() = delete; static void OnPluginEvent(const ezPluginEvent& e); EZ_MAKE_SUBSYSTEM_STARTUP_FRIEND(Foundation, StackTracer); };