2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: Debug.cpp
|
|
|
|
Date: 2021-6-12
|
|
|
|
Author: Reece
|
|
|
|
***/
|
2021-09-30 14:57:41 +00:00
|
|
|
#include <Source/RuntimeInternal.hpp>
|
2021-06-27 21:25:29 +00:00
|
|
|
#include "Debug.hpp"
|
2021-09-30 14:57:41 +00:00
|
|
|
#include <Source/Telemetry/Telemetry.hpp>
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
2022-01-29 11:49:11 +00:00
|
|
|
#include "ExceptionWatcher.NT.hpp"
|
|
|
|
#include "ExceptionWatcher.Win32.hpp"
|
|
|
|
#include "Stack.Win32.hpp"
|
2021-06-27 21:25:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace Aurora::Debug
|
|
|
|
{
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
static thread_local AuUInt32 tlsLastBackTrace = 0xFFFFFFFF;
|
|
|
|
static thread_local StackTrace tlsLastStackTrace;
|
|
|
|
static thread_local AuString tlsLastExceptionMessage;
|
|
|
|
static thread_local EFailureCategory tlsCategory = EFailureCategory::kFailureNone;
|
2022-01-21 16:26:35 +00:00
|
|
|
|
2022-01-18 14:26:38 +00:00
|
|
|
static AuUInt32 gStackTraceFence;
|
|
|
|
static AuUInt32 gFenceId;
|
|
|
|
static AuThreadPrimitives::SpinLock gLock;
|
2021-06-27 21:25:29 +00:00
|
|
|
static AuUInt32 gFenceOSError = -1;
|
2022-01-18 14:26:38 +00:00
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
AuUInt32 GetOSErrorFence()
|
|
|
|
{
|
|
|
|
return gFenceOSError;
|
|
|
|
}
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
AuString GetOSErrorStringWin32(DWORD error)
|
|
|
|
{
|
|
|
|
AuString ret;
|
2021-09-06 10:58:08 +00:00
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
2021-06-27 21:25:29 +00:00
|
|
|
char *err = nullptr;
|
2022-01-18 14:26:38 +00:00
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
if (!FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
|
|
|
NULL,
|
|
|
|
error,
|
|
|
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
|
|
(LPTSTR)&err,
|
|
|
|
0,
|
|
|
|
NULL))
|
|
|
|
{
|
2021-09-06 10:58:08 +00:00
|
|
|
return {};
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
ret = err;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{}
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
LocalFree(err);
|
2021-09-06 10:58:08 +00:00
|
|
|
#endif
|
2021-06-27 21:25:29 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
AuOptional<OSError_t> TryFetchOSError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
static OSError_t lastError{};
|
|
|
|
|
|
|
|
OSError_t ret{};
|
|
|
|
|
|
|
|
ret.first = GetLastError();
|
|
|
|
if ((ret.first == ERROR_SUCCESS) ||
|
|
|
|
(ret.first == WSAEWOULDBLOCK))
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lastError.first == ret.first)
|
|
|
|
{
|
|
|
|
return lastError;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret.second = GetOSErrorStringWin32(lastError.first);
|
|
|
|
|
|
|
|
gFenceOSError++;
|
2022-01-18 14:26:38 +00:00
|
|
|
gFenceId++;
|
2021-06-27 21:25:29 +00:00
|
|
|
return lastError = ret;
|
|
|
|
}
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
AuOptional<OSError_t> TryGetOrFetchOSError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2021-09-06 10:58:08 +00:00
|
|
|
static AuOptional<OSError_t> lastErrorError;
|
|
|
|
static AuOptional<AuUInt32> lastErrorFence;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
AuOptional<OSError_t> tempError = TryFetchOSError();
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
if (!tempError)
|
|
|
|
{
|
|
|
|
return lastErrorError;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lastErrorFence)
|
|
|
|
{
|
|
|
|
if (lastErrorFence.value() != GetOSErrorFence())
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_SUCCESS);
|
|
|
|
Telemetry::InsertOSError(tempError.value());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lastErrorFence = GetOSErrorFence();
|
|
|
|
lastErrorError = tempError;
|
|
|
|
return tempError;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
AuOptional<OSError_t> TryFetchOSError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
AuOptional<OSError_t> TryGetOrFetchOSError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static AuUInt32 gFenceCError = -1;
|
|
|
|
AuUInt32 GetCErrorFence()
|
|
|
|
{
|
|
|
|
return gFenceCError;
|
|
|
|
}
|
|
|
|
|
2022-01-18 14:26:38 +00:00
|
|
|
AuOptional<AuUInt32> TryFetchCError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-18 14:26:38 +00:00
|
|
|
static AuUInt32 lastError = 0;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
auto errorNumber = errno;
|
|
|
|
if (!errorNumber)
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lastError == errorNumber)
|
|
|
|
{
|
|
|
|
return errorNumber;
|
|
|
|
}
|
|
|
|
|
|
|
|
gFenceCError++;
|
2022-01-18 14:26:38 +00:00
|
|
|
gFenceId++;
|
2021-06-27 21:25:29 +00:00
|
|
|
return lastError = errorNumber;
|
|
|
|
}
|
|
|
|
|
2022-01-18 14:26:38 +00:00
|
|
|
AuOptional<AuUInt32> TryGetOrFetchCError()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-18 14:26:38 +00:00
|
|
|
static AuOptional<AuUInt32> lastErrorError;
|
2021-09-06 10:58:08 +00:00
|
|
|
static AuOptional<AuUInt32> lastErrorFence;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-18 14:26:38 +00:00
|
|
|
AuOptional<AuUInt32> tempError = TryFetchCError();
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
if (!tempError)
|
|
|
|
{
|
|
|
|
return lastErrorError;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lastErrorFence)
|
|
|
|
{
|
|
|
|
if (lastErrorFence.value() != GetCErrorFence())
|
|
|
|
{
|
|
|
|
errno = 0;
|
|
|
|
Telemetry::InsertCError(tempError.value());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lastErrorFence = GetCErrorFence();
|
|
|
|
lastErrorError = tempError;
|
|
|
|
return tempError;
|
|
|
|
}
|
|
|
|
|
2022-01-21 16:26:35 +00:00
|
|
|
AuUInt32 ReportStackTrace(const StackTrace& trace, const AuString& message)
|
2022-01-18 14:26:38 +00:00
|
|
|
{
|
|
|
|
AU_LOCK_GUARD(gLock);
|
2022-01-24 18:37:06 +00:00
|
|
|
tlsLastStackTrace = trace;
|
|
|
|
tlsLastExceptionMessage = message;
|
2022-01-21 16:26:35 +00:00
|
|
|
tlsLastBackTrace = gStackTraceFence++;
|
2022-01-18 14:26:38 +00:00
|
|
|
gFenceId++;
|
2022-01-21 16:26:35 +00:00
|
|
|
return tlsLastBackTrace;
|
2022-01-18 14:26:38 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
AuUInt32 GetFenceId()
|
|
|
|
{
|
2022-01-21 16:26:35 +00:00
|
|
|
return gFenceId++;
|
2022-01-18 14:26:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuString GetLastErrorStack()
|
|
|
|
{
|
|
|
|
return StringifyStackTrace(GetLastStackTrace());
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM StackTrace GetLastStackTrace()
|
|
|
|
{
|
|
|
|
AU_LOCK_GUARD(gLock);
|
2022-01-24 18:37:06 +00:00
|
|
|
return tlsLastStackTrace;
|
2022-01-18 14:26:38 +00:00
|
|
|
}
|
|
|
|
|
2022-01-26 08:30:19 +00:00
|
|
|
AUKN_SYM StackTrace GetStackTrace()
|
|
|
|
{
|
2022-01-29 11:49:11 +00:00
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
|
|
return PlatformWalkCallStack();
|
|
|
|
#else
|
2022-01-26 08:30:19 +00:00
|
|
|
return {};
|
2022-01-29 11:49:11 +00:00
|
|
|
#endif
|
2022-01-26 08:30:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-18 14:26:38 +00:00
|
|
|
AUKN_SYM AuString GetLastException()
|
|
|
|
{
|
|
|
|
AU_LOCK_GUARD(gLock);
|
2022-01-24 18:37:06 +00:00
|
|
|
return tlsLastExceptionMessage;
|
2022-01-18 14:26:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM OSError_t GetLastSystemMessage()
|
|
|
|
{
|
|
|
|
return TryGetOrFetchOSError().value_or(OSError_t{});
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
AUKN_SYM void ErrorCategorySet(EFailureCategory category)
|
|
|
|
{
|
|
|
|
tlsCategory = category;
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM void ErrorCategoryClear()
|
|
|
|
{
|
|
|
|
tlsCategory = EFailureCategory::kFailureNone;
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM EFailureCategory ErrorCategoryGet()
|
|
|
|
{
|
|
|
|
return tlsCategory;
|
|
|
|
}
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
AUKN_SYM void PrintError()
|
|
|
|
{
|
|
|
|
AuUInt32 rng = GetFenceId();
|
|
|
|
|
2022-01-21 16:26:35 +00:00
|
|
|
Telemetry::BeginBlock();
|
|
|
|
try
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-21 16:26:35 +00:00
|
|
|
Telemetry::InsertManualFence(rng);
|
|
|
|
|
|
|
|
static AuUInt32 cLastFence = 0;
|
|
|
|
auto cFence = GetCErrorFence();
|
|
|
|
auto cError = TryGetOrFetchCError();
|
|
|
|
if ((cError) && (cFence != cLastFence))
|
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
AuLogWarn("Language Error: {} ({})", strerror(*cError), *cError);
|
2022-01-21 16:26:35 +00:00
|
|
|
cLastFence = cFence;
|
|
|
|
}
|
|
|
|
|
|
|
|
static AuUInt32 osLastFence = 0;
|
|
|
|
auto osFence = GetOSErrorFence();
|
|
|
|
auto osError = TryGetOrFetchOSError();
|
|
|
|
if ((osError) && (osFence != osLastFence))
|
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
AuLogWarn("Operating System Error: {} (0x{:x})", osError->second, osError->first);
|
2022-01-21 16:26:35 +00:00
|
|
|
osLastFence = osFence;
|
|
|
|
}
|
|
|
|
|
|
|
|
Telemetry::InsertBackTrace(tlsLastBackTrace);
|
|
|
|
Telemetry::InsertManualFence(rng);
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
2022-01-21 16:26:35 +00:00
|
|
|
catch (...)
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
}
|
2022-01-21 16:26:35 +00:00
|
|
|
Telemetry::EndBlock();
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
AUKN_SYM void CheckErrors()
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
AuUInt32 rng = GetFenceId();
|
2022-01-21 16:26:35 +00:00
|
|
|
Telemetry::BeginBlock();
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Telemetry::InsertManualFence(rng);
|
|
|
|
TryGetOrFetchCError();
|
|
|
|
TryGetOrFetchOSError();
|
|
|
|
Telemetry::InsertBackTrace(tlsLastBackTrace);
|
|
|
|
Telemetry::InsertManualFence(rng);
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
Telemetry::EndBlock();
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
2021-10-24 09:04:02 +00:00
|
|
|
AUKN_SYM void _PushError(AuUInt address, EFailureCategory category, const char *msg)
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
LastError error {address, category, msg};
|
2021-09-07 07:37:15 +00:00
|
|
|
|
|
|
|
// Oi, developer
|
|
|
|
#if defined(DEBUG)
|
|
|
|
DebugBreak();
|
|
|
|
#endif
|
2021-06-27 21:25:29 +00:00
|
|
|
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
tlsCategory = category;
|
|
|
|
|
2021-09-07 07:37:15 +00:00
|
|
|
// Cry about it to telemetry with other errors if available
|
2021-06-27 21:25:29 +00:00
|
|
|
AuUInt32 rng = GetFenceId();
|
2022-01-21 16:26:35 +00:00
|
|
|
Telemetry::BeginBlock();
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Telemetry::InsertManualFence(rng);
|
|
|
|
Telemetry::InsertMsgError(error);
|
|
|
|
TryGetOrFetchCError();
|
|
|
|
TryGetOrFetchOSError();
|
|
|
|
Telemetry::InsertBackTrace(tlsLastBackTrace);
|
|
|
|
Telemetry::InsertManualFence(rng);
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
Telemetry::EndBlock();
|
2021-09-07 07:37:15 +00:00
|
|
|
|
|
|
|
// Eh, dont spam nested to a logger if its not going to make sense to a normie
|
2021-10-24 09:04:02 +00:00
|
|
|
if ((category == EFailureCategory::kFailureNested) && (msg == nullptr))
|
2021-09-07 07:37:15 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
|
|
|
|
// Print to console if internal
|
2021-09-06 10:58:08 +00:00
|
|
|
#if defined(DEBUG) || defined(STAGING)
|
2021-06-30 16:33:18 +00:00
|
|
|
PrintError();
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
|
|
|
|
// Is anyone listening?
|
2022-01-24 18:37:06 +00:00
|
|
|
AuLogWarn("ERROR: {}", error.dbg);
|
2021-06-30 09:28:52 +00:00
|
|
|
#endif
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuString StackTraceEntry::Stringify() const
|
|
|
|
{
|
|
|
|
const auto frame = *this;
|
2021-09-06 10:58:08 +00:00
|
|
|
AuString backTraceBuffer;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
backTraceBuffer.reserve(512 - 32); // 512 seems like a nice length minus some overhead for a bucket allocator
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
backTraceBuffer += fmt::format("\tAddress: 0x{:x} (0x{:x})", frame.relAddress ? frame.relAddress : frame.address, frame.relAddress ? frame.address : frame.relAddress);
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
if (frame.module)
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
auto modName = frame.module.value();
|
|
|
|
if (modName.size())
|
|
|
|
{
|
|
|
|
backTraceBuffer += fmt::format(" within {}", modName);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backTraceBuffer += ", invalid module";
|
|
|
|
}
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
backTraceBuffer += ", unknown module";
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
if (frame.label)
|
|
|
|
{
|
|
|
|
backTraceBuffer += fmt::format(" ({}) \n", frame.label.value());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backTraceBuffer += ", unknown function\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (frame.file)
|
|
|
|
{
|
|
|
|
const auto &re = frame.file.value();
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
backTraceBuffer += fmt::format("\t\t{}:{} ({}) \n", AuGet<0>(re), AuGet<1>(re), AuGet<2>(re));
|
2022-01-24 18:37:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backTraceBuffer += "\t\t[proprietary]\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return backTraceBuffer;
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
2022-01-24 18:37:06 +00:00
|
|
|
catch (...)
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
return {};
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuString StringifyStackTrace(const StackTrace &backtrace)
|
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
AuString backTraceBuffer;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
backTraceBuffer.reserve(2048);
|
|
|
|
|
|
|
|
backTraceBuffer += "Unwinding call frame:";
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
for (const auto &frame : backtrace)
|
|
|
|
{
|
|
|
|
backTraceBuffer += "\n";
|
|
|
|
backTraceBuffer += frame.Stringify();
|
|
|
|
}
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-01-24 18:37:06 +00:00
|
|
|
return backTraceBuffer;
|
|
|
|
}
|
|
|
|
catch (...)
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
2022-01-24 18:37:06 +00:00
|
|
|
return {};
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitDebug()
|
|
|
|
{
|
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
|
|
InitWin32();
|
|
|
|
#endif
|
2022-01-27 05:24:08 +00:00
|
|
|
|
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
|
|
InitNT();
|
|
|
|
#endif
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|
|
|
|
}
|