Better support for breakpoints.

This commit is contained in:
Bruce Hill 2018-03-13 15:55:14 -07:00
parent 09f6ab22ef
commit 4eaf439932
2 changed files with 7 additions and 0 deletions

View File

@ -344,6 +344,7 @@ main_loop = function(err_msg, stack_index, var_index, value_index)
local file = stack_locations[stack_pad.selected]
local filename, line_no = file:match("([^:]*):(.*)")
C.endwin()
err_pad, stack_pad, var_names, var_values = nil, nil, nil, nil
os.execute((os.getenv("EDITOR") or "nano") .. " +" .. line_no .. " " .. filename)
local initial_index = stack_pad.selected
return main_loop(err_msg, stack_pad.selected, var_index)
@ -351,6 +352,8 @@ main_loop = function(err_msg, stack_index, var_index, value_index)
break
end
end
err_pad, stack_pad, var_names, var_values = nil, nil, nil, nil
return C.endwin()
end
run_debugger = function(err_msg)
stdscr = C.initscr()

View File

@ -264,6 +264,7 @@ main_loop = (err_msg, stack_index, var_index, value_index)->
filename,line_no = file\match("([^:]*):(.*)")
-- Launch system editor and then redraw everything
C.endwin!
err_pad, stack_pad, var_names, var_values = nil, nil, nil, nil
os.execute((os.getenv("EDITOR") or "nano").." +"..line_no.." "..filename)
initial_index = stack_pad.selected
return main_loop(err_msg,stack_pad.selected,var_index)
@ -271,6 +272,9 @@ main_loop = (err_msg, stack_index, var_index, value_index)->
when ('q')\byte!, ("Q")\byte!
break
err_pad, stack_pad, var_names, var_values = nil, nil, nil, nil
C.endwin!
run_debugger = (err_msg)->
export stdscr, SCREEN_H, SCREEN_W
stdscr = C.initscr!