Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/mobdebug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ local step_level = 0
local stack_level = 0
local server
local buf
local start_input_line
local start_input_error
local outputs = {}
local iobase = {print = print}
local basedir = ""
Expand Down Expand Up @@ -778,7 +780,13 @@ local function debugger_loop(sev, svars, sfile, sline)
local line, err
if mobdebug.yield and server.settimeout then server:settimeout(mobdebug.yieldtimeout) end
while true do
line, err = server:receive("*l")
if start_input_line then
line, err = start_input_line, start_input_error
start_input_line = nil
start_input_error = nil
else
line, err = server:receive("*l")
end
if not line then
if err == "timeout" then
if mobdebug.yield then mobdebug.yield() end
Expand Down Expand Up @@ -1069,6 +1077,10 @@ local function start(controller_host, controller_port)
local err
server, err = mobdebug.connect(controller_host, controller_port)
if server then
local line, receive_err = server:receive("*l")
start_input_line = line
start_input_error = receive_err

-- correct stack depth which already has some calls on it
-- so it doesn't go into negative when those calls return
-- as this breaks subsequence checks in stack_depth().
Expand Down