From d2900df0f6d8f1636cc18d59935ef86f118090c7 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 24 Oct 2020 00:32:47 +0800 Subject: [PATCH] Add debug break hook for Lua --- ryzom/common/data_common/r2/r2_debug.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ryzom/common/data_common/r2/r2_debug.lua b/ryzom/common/data_common/r2/r2_debug.lua index 78501dcab..f32a75017 100644 --- a/ryzom/common/data_common/r2/r2_debug.lua +++ b/ryzom/common/data_common/r2/r2_debug.lua @@ -132,6 +132,11 @@ end -- INIT -- ---------- +if debugBreak == nil then + -- replace this at runtime with the debugger break functions + debugBreak = function() + end +end -- replace the assert function with a more verbose one if oldAssert == nil then @@ -142,7 +147,8 @@ function assert(cond) if not cond then -- rawDebugInfo(colorTag(255, 0, 255) .. "ASSERTION FAILED !! ") rawDebugInfo("@{FOFF}ASSERTION FAILED !! ") - dumpCallStack(2); + dumpCallStack(2) + debugBreak() error("") end end