lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 12/19/2013 03:41 PM, Paul K wrote:
Hi Thomas,

I see that you support different Lua debugger back ends. I have my own back-end as well, do you think it would be easily possible to integrate my own ZeroBrane debugger binding? I have to say, that in my debugger the IDE attaches to the interpreter and not the other way around.
The interface between the debugger and the IDE was designed with the
idea of plugging in different back-ends, but the interaction got more
complicated and the current API needs to be reviewed.

Do you have a description for the API used by the debugger you have in
mind? The API used is described in src/editor/debugger.lua with
various debugger.* methods, but I'm not sure yet how difficult it's to
change from "listening" to "attaching" model and how to "stub" the
methods other debuggers may not support.

Paul
I looked at the file, I think most of the things I want to do are possible. There are actually levels of API, the first is the communication which is mapped to a few C functions. I can easily bind those to Lua.

Than I can write simple statements like (in the src/editor/debugger.lua):
INCO.CallProcedure('Targetname', 'LuaStatename', 'SetBreakpoint("Filename", 12, 1)')
INCO.CallProcedure('Targetname', 'LuaStatename', 'StepOver()')

ticket = INCO.CallProcedureEx('Targetname', 'LuaStatename', 'GetStack("TaskName", 1, "Sl")')
local source = INCO.GetResult('Targetname', ticket)
local line = INCO.GetResult('Targetname', ticket)

I think you get the idea, it's all straight forward, a mapping of the Lua C debug API. The biggest difference is probably that I use Lua's debug API and not the Lua library.
--
Thomas