From 8b4e25b421a4ef13f8dcd927ab86649463b890bf Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 5 Mar 2021 12:38:44 +0000 Subject: [PATCH] Fix CATCH_BREAK_INTO_DEBUGGER that by default surrounds in a lambda * This is a lambda in upstream catch to avoid some warning, but that means that when the debugbreak happens it's in the wrong stack frame (though at least on the right line). Fortunately we can override it with a useful definition. --- renderdoc/3rdparty/catch/catch.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/renderdoc/3rdparty/catch/catch.hpp b/renderdoc/3rdparty/catch/catch.hpp index 971706696..eccc06220 100644 --- a/renderdoc/3rdparty/catch/catch.hpp +++ b/renderdoc/3rdparty/catch/catch.hpp @@ -29,6 +29,13 @@ #define CATCH_CONFIG_FORCE_FALLBACK_STRINGIFIER #define CATCH_CONFIG_INLINE_DEBUG_BREAK +// define the debugbreak to not be in a lambda, so that we get the right stack frame! +#define CATCH_BREAK_INTO_DEBUGGER() \ + if(Catch::isDebuggerActive()) \ + { \ + CATCH_TRAP(); \ + } + #include "api/replay/rdcstr.h" #include "api/replay/stringise.h"