46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
struct UIEditorCrashTraceFrame {
|
|
std::uintptr_t address = 0u;
|
|
std::uintptr_t displacement = 0u;
|
|
std::uint32_t line = 0u;
|
|
std::uint32_t lineDisplacement = 0u;
|
|
std::string moduleName = {};
|
|
std::string symbolName = {};
|
|
std::string sourceFile = {};
|
|
};
|
|
|
|
struct UIEditorCrashTrace {
|
|
std::uint32_t exceptionCode = 0u;
|
|
const void* exceptionAddress = nullptr;
|
|
std::uint32_t threadId = 0u;
|
|
std::string exceptionModule = {};
|
|
std::vector<UIEditorCrashTraceFrame> stackFrames = {};
|
|
};
|
|
|
|
void InitializeUIEditorRuntimeTrace(const std::filesystem::path& logRoot);
|
|
void ShutdownUIEditorRuntimeTrace();
|
|
|
|
void AppendUIEditorRuntimeTrace(
|
|
std::string_view channel,
|
|
std::string_view message);
|
|
|
|
void AppendUIEditorCrashTrace(
|
|
std::uint32_t exceptionCode,
|
|
const void* exceptionAddress);
|
|
void AppendUIEditorCrashTrace(const UIEditorCrashTrace& trace);
|
|
|
|
std::filesystem::path GetUIEditorRuntimeTracePath();
|
|
std::filesystem::path GetUIEditorCrashTracePath();
|
|
bool IsUIEditorRuntimeTraceInitialized();
|
|
|
|
} // namespace XCEngine::UI::Editor
|