AuroraRuntime/Source/Debug/Debug.hpp

39 lines
997 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Debug.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
#if defined(STAGING) || defined(DEBUG) // not including ship -> do not spam end users with trash they do not understand, do not waste memory on debug cache
#define _AU_USE_EXTENDED_FWD_FACING_DEBUGGING
#endif
namespace Aurora::Debug
{
struct LastError
{
AuUInt uAddress;
EFailureCategory category;
const char *pDbgMessage;
AuUInt16 uLine;
};
AuUInt32 GetOSErrorFence();
AuOptional<OSError_t> TryGetOrFetchOSError();
AuUInt32 GetCErrorFence();
AuOptional<AuUInt32> TryGetOrFetchCError();
AuOptional<OSError_t> TryFetchOSError();
AuOptional<AuUInt32> TryFetchCError();
AuUInt32 ReportStackTrace(const StackTrace &trace, const AuString &message);
void CheckErrors();
void PlatformHandleFatal(bool fatal, bool bNoExit = false);
void InitDebug();
}