Adding a dbg.msgh() function to make it easier to use with lua_pcall() from C.

This commit is contained in:
slembcke 2015-11-05 18:39:56 -06:00
parent 912d64f548
commit 100874d6ba
1 changed files with 8 additions and 0 deletions

View File

@ -407,6 +407,14 @@ function dbg.call(f, l)
end))
end
-- Error message handler that can be used with lua_pcall().
function dbg.msgh(...)
print(...)
dbg(false, 1)
return ...
end
-- Detect Lua version.
if jit then -- LuaJIT
dbg.writeln(COLOR_RED.."debugger.lua: Loaded for "..jit.version..COLOR_RESET)