Implement default debugger REPL loop
This commit is contained in:
parent
98018e4a8c
commit
3d293d3e68
16
debugger.lua
16
debugger.lua
@ -43,4 +43,18 @@ local function debugREPL(onResult, debugArgs)
|
||||
return success, (not success and retval) or nil
|
||||
end
|
||||
|
||||
return { debugREPL = debugREPL, execDebug = execDebug }
|
||||
local function hookDebugger(context, Logger)
|
||||
Logger = Logger or require("logging").getGlobalLogger()
|
||||
|
||||
local result, retval
|
||||
repeat
|
||||
result, retval = debugREPL(function(r)
|
||||
Logger:error("->", r)
|
||||
end, context)
|
||||
if not result then
|
||||
Logger:error("x>", retval)
|
||||
end
|
||||
until result
|
||||
end
|
||||
|
||||
return { debugREPL = debugREPL, execDebug = execDebug, hookDebugger = hookDebugger }
|
Loading…
x
Reference in New Issue
Block a user