From 6de8ed48319eaf035557b93e6415b33579a11fe1 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 12 Apr 2021 16:11:14 +1000 Subject: [PATCH] debug: move the panic code out of assert --- debug/assert.cpp | 33 +-------------------------------- debug/panic.cpp | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/debug/assert.cpp b/debug/assert.cpp index 0f775d3e..dcd60852 100644 --- a/debug/assert.cpp +++ b/debug/assert.cpp @@ -6,35 +6,4 @@ * Copyright 2010-2019 Danny Robson */ -#include "./assert.hpp" - -#include "../backtrace.hpp" -#include "../log.hpp" - -#include - - -//////////////////////////////////////////////////////////////////////////////// -void -cruft::debug::detail::panic (const char *msg) -{ - std::cerr << "PANIC: " << msg << "\n" << ::cruft::backtrace () << std::endl; - breakpoint (); - abort (); -} - - -//////////////////////////////////////////////////////////////////////////////// -void -cruft::debug::detail::not_implemented (const char *msg) -{ - panic (msg); -} - - -//----------------------------------------------------------------------------- -void -cruft::debug::detail::unreachable (const char *msg) -{ - panic (msg); -} \ No newline at end of file +#include "./assert.hpp" \ No newline at end of file diff --git a/debug/panic.cpp b/debug/panic.cpp index e01d71f3..4693d1ae 100644 --- a/debug/panic.cpp +++ b/debug/panic.cpp @@ -1 +1,32 @@ -#include "panic.hpp" \ No newline at end of file +#include "panic.hpp" + +#include "./debugger.hpp" + +#include "../backtrace.hpp" + +#include + + +//////////////////////////////////////////////////////////////////////////////// +void +cruft::debug::detail::panic (const char *msg) +{ + std::cerr << "PANIC: " << msg << "\n" << ::cruft::backtrace () << std::endl; + breakpoint (); + abort (); +} + +//////////////////////////////////////////////////////////////////////////////// +void +cruft::debug::detail::not_implemented (const char *msg) +{ + panic (msg); +} + + +//----------------------------------------------------------------------------- +void +cruft::debug::detail::unreachable (const char *msg) +{ + panic (msg); +}