MCPcopy Create free account
hub / github.com/crownengine/crown / defaultAssertHandler

Function defaultAssertHandler

3rdparty/bx/src/bx.cpp:26–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 static bool defaultAssertHandler(const Location& _location, uint32_t _skip, const char* _format, va_list _argList)
27 {
28 char temp[8192];
29 int32_t total = 0;
30
31 StaticMemoryBlockWriter smb(temp, BX_COUNTOF(temp) );
32
33 ErrorIgnore err;
34
35 total += write(&smb, &err, "\n--- ASSERT ---\n\n");
36
37 total += write(&smb, &err, "%s(%d): "
38 , _location.filePath
39 , _location.line
40 );
41 total += write(&smb, _format, _argList, &err);
42 total += write(&smb, "\n\n", &err);
43
44 uintptr_t stack[32];
45 const uint32_t num = getCallStackExact(2 /* skip self */ + _skip, BX_COUNTOF(stack), stack);
46 total += writeCallstack(&smb, stack, num, &err);
47
48 total += write(&smb, &err,
49 "\nBuild info:\n"
50 "\tCompiler: " BX_COMPILER_NAME
51 ", CPU: " BX_CPU_NAME
52 ", Arch: " BX_ARCH_NAME
53 ", OS: " BX_PLATFORM_NAME
54 ", CRT: " BX_CRT_NAME
55 ", C++: " BX_CPP_NAME
56
57 ", Date: " __DATE__
58 ", Time: " __TIME__
59 "\n"
60 );
61
62 total += write(&smb, &err, "\n--- END ---\n\n");
63
64 write(getDebugOut(), temp, total, ErrorIgnore{});
65
66 return true;
67 }
68
69 static AssertHandlerFn s_assertHandler = defaultAssertHandler;
70

Callers

nothing calls this directly

Calls 4

getCallStackExactFunction · 0.85
writeCallstackFunction · 0.85
getDebugOutFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected