2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: Debug.hpp
|
|
|
|
Date: 2021-6-9
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Aurora/Console/Console.hpp>
|
|
|
|
|
|
|
|
#include "StackTrace.hpp"
|
2021-10-24 09:04:02 +00:00
|
|
|
#include "EFailureCategory.hpp"
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
namespace Aurora::Debug
|
|
|
|
{
|
2022-01-18 14:26:38 +00:00
|
|
|
using OSError_t = AuPair<AuUInt64, AuString>;
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
/**
|
|
|
|
Retrieves a print-friendly callstack of the last trap (either innocent exception or fatal mem access) <br>
|
2022-01-29 11:49:11 +00:00
|
|
|
On Win32, this information is always available
|
2021-06-27 21:25:29 +00:00
|
|
|
*/
|
|
|
|
AUKN_SYM AuString GetLastErrorStack();
|
|
|
|
|
|
|
|
AUKN_SYM StackTrace GetLastStackTrace();
|
2022-01-26 08:30:19 +00:00
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
/**
|
2022-01-29 11:49:11 +00:00
|
|
|
Retrieve information about the last exception.
|
|
|
|
On Win32, this information is always available
|
2021-06-27 21:25:29 +00:00
|
|
|
*/
|
|
|
|
AUKN_SYM AuString GetLastException();
|
|
|
|
|
|
|
|
/**
|
2022-01-29 11:49:11 +00:00
|
|
|
Retrieve the last system error (Example -> Win32, GetLastError())
|
2021-06-27 21:25:29 +00:00
|
|
|
*/
|
2022-01-18 14:26:38 +00:00
|
|
|
AUKN_SYM OSError_t GetLastSystemMessage();
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Prints the current error state of the thread including: <br>
|
|
|
|
Current System Error, <br>
|
|
|
|
Current Runtime Error, <br>
|
|
|
|
Last Exception Call Stack, <br>
|
|
|
|
Last major ring notification
|
|
|
|
|
|
|
|
*/
|
|
|
|
AUKN_SYM void PrintError();
|
2022-01-24 18:37:06 +00:00
|
|
|
|
2022-01-29 11:49:11 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
AUKN_SYM void CheckErrors();
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-29 11:49:11 +00:00
|
|
|
|
|
|
|
AUKN_SYM StackTrace GetStackTrace();
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
/**
|
|
|
|
Immediately terminates the process.
|
|
|
|
May attempt some hardened telemetry debug ops
|
|
|
|
*/
|
|
|
|
AUKN_SYM AU_NORETURN void Panic();
|
2021-09-06 10:58:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
AUKN_SYM void DebugBreak();
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "SysPanic.hpp"
|
|
|
|
#include "SysAssertions.hpp"
|
|
|
|
#include "SysErrors.hpp"
|