From d2b615061e008c4d13a6ce0f11efd8ec337f41c6 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 3 Sep 2022 17:33:07 +0300 Subject: Impl breakpoints (pretty much draft) Breakpoints work somehow, but overstep 1 instruction. Needs to be fixed. --- utils.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'utils.hpp') diff --git a/utils.hpp b/utils.hpp index 4a83a8d..0c49739 100644 --- a/utils.hpp +++ b/utils.hpp @@ -3,13 +3,19 @@ #pragma once +#if defined(NDEBUG) #ifdef __clang__ -# define UNREACHABLE __builtin_unreachable +# define UNREACHABLE (__builtin_unreachable()) #elif __GNUC__ -# define UNREACHABLE __builtin_unreachable +# define UNREACHABLE (__builtin_unreachable()) #else # define UNREACHABLE #endif +#else +#include +#define UNREACHABLE (assert((void*)0 == "Unreachable code reached"), abort(), 1) +#endif + #include -- cgit v1.2.3