From 20ab0bc13ac84691e2e9320c9a3ae0fedd7e79c3 Mon Sep 17 00:00:00 2001 From: Jakob Rath Date: Wed, 16 Aug 2023 09:36:28 +0200 Subject: [PATCH] Invoke debugger if VERIFY fails in debug mode --- src/util/debug.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/debug.h b/src/util/debug.h index 6ee0d6c8d..5f44a5163 100644 --- a/src/util/debug.h +++ b/src/util/debug.h @@ -97,6 +97,7 @@ bool is_debug_enabled(const char * tag); #define VERIFY(_x_) if (!(_x_)) { \ notify_assertion_violation(__FILE__, __LINE__, "Failed to verify: " #_x_ "\n"); \ + DEBUG_CODE({ INVOKE_DEBUGGER(); }); \ exit(ERR_UNREACHABLE); \ } @@ -104,6 +105,7 @@ bool is_debug_enabled(const char * tag); if (!((LHS) == (RHS))) { \ notify_assertion_violation(__FILE__, __LINE__, "Failed to verify: " #LHS " == " #RHS "\n"); \ std::cerr << "LHS value: " << (LHS) << "\nRHS value: " << (RHS) << "\n"; \ + DEBUG_CODE({ INVOKE_DEBUGGER(); }); \ exit(ERR_UNREACHABLE); \ }