#pragma once #include #include #include #include "include/ztypes.h" void dbgln(const glcr::StringView& str); template void dbgln(const char* str, Args... args) { char buffer[256]; glcr::FixedStringBuilder builder(buffer, 256); glcr::StrFormatIntoBuffer(builder, str, args...); dbgln(builder); } template void dbgln_large(const char* str, Args... args) { dbgln(glcr::StrFormat(str, args...)); } template void panic(const char* str, Args... args) { dbgln(str, args...); dbgln("PANIC"); asm volatile("hlt;"); } #define UNREACHABLE \ panic("Unreachable {}, {}", __FILE__, __LINE__); \ __builtin_unreachable();