8#include "architecture.hpp"
15#if TT_OPERATING_SYSTEM == TT_OS_WINDOWS
16void _debugger_break();
17#define tt_debugger_break() _debugger_break()
19#elif TT_COMPILER == TT_CC_GCC || TT_COMPILER == TT_CC_CLANG
20#define tt_debugger_break() __builtin_trap()
23#error "Not implemented"
29bool debugger_is_present() noexcept;
38template<typename... Args>
39[[noreturn]] tt_no_inline
void debugger_abort(
char const *source_file,
int source_line,
std::string_view fmt, Args &&... args)
43 if constexpr (
sizeof...(Args) == 0) {
46 message = std::format(fmt, std::forward<Args>(args)...);
49 if (debugger_is_present()) {
50 print(
"{}:{} {}\n", source_file, source_line, message);
53 dialog_ok(
"Aborting",
"{}:{} {}", source_file, source_line, message);
59[[noreturn]] tt_no_inline
inline void debugger_abort(
char const *source_file,
int source_line)
61 debugger_abort(source_file, source_line,
"<unknown>");
64#define tt_debugger_abort(...) ::tt::debugger_abort(__FILE__, __LINE__ __VA_OPT__(,) __VA_ARGS__)