diff options
author | nat-goodspeed <nat@lindenlab.com> | 2024-03-01 08:55:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 08:55:32 -0500 |
commit | de71c6378e60c0f0ea0c5537729f052da8513b19 (patch) | |
tree | b92852f9c9b790fbae1b199c2dd835852ccb79cd /indra/test | |
parent | 777586a1865b496f8bfea9651afbd481ea23b4f7 (diff) | |
parent | 80c157661b694b0e38716b34dd8015cbf646186e (diff) |
Merge pull request #905 from secondlife/require-tweaks
Refactor `require()` to make it easier to reason about Lua stack usage.
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/debug.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/indra/test/debug.h b/indra/test/debug.h index f92cce3008..3c4f3cabb4 100644 --- a/indra/test/debug.h +++ b/indra/test/debug.h @@ -31,6 +31,7 @@ #include "print.h" #include "stringize.h" +#include <exception> // std::uncaught_exceptions() /***************************************************************************** * Debugging stuff @@ -65,10 +66,12 @@ public: // non-copyable Debug(const Debug&) = delete; + Debug& operator=(const Debug&) = delete; ~Debug() { - (*this)("exit"); + auto exceptional{ std::uncaught_exceptions()? "exceptional " : "" }; + (*this)(exceptional, "exit"); } template <typename... ARGS> @@ -90,20 +93,4 @@ private: // of the Debug block. #define DEBUG Debug debug(LL_PRETTY_FUNCTION) -// These DEBUGIN/DEBUGEND macros are specifically for debugging output -- -// please don't assume you must use such for coroutines in general! They only -// help to make control flow (as well as exception exits) explicit. -#define DEBUGIN \ -{ \ - DEBUG; \ - try - -#define DEBUGEND \ - catch (...) \ - { \ - debug("*** exceptional "); \ - throw; \ - } \ -} - #endif /* ! defined(LL_DEBUG_H) */ |