Hi Ignacio, > 1: setInterval(function() > 2: console.log("%s", os.time()) > 3: end, 2000) > 4: process:loop() > I can put a breakpoint at line 1, but a breakpoint in line 2 is never hit. You may be doing everything correctly, but if your function in setInterval parameter is called from a coroutine, then debugging for those needs to be explicitly enabled. debug.hook in Lua needs to be set on every coroutine and because those can be created at run-time, you need to tell the debugger that this needs to be done (this is off by default). It's a bit different with LuaJIT, but the behavior of the debugger under LuaJIT mimics the behavior of the "normal" Lua interpreter. You have two options to do this: 1. Enable coroutine debugging globally by calling require("mobdebug").coro(). This only works if coroutine.create() is used and most likely not work if you create coroutines from C/C++ code. 2. Enable coroutine debugging on a case-by-case basis. call require("mobdebug").on() from the coroutine you want to be able to debug. You only need to do it once per coroutine > 1: setInterval(function() require("mobdebug").on() --<-- add this; won't do any harm if it's already "on" or if the debugging is not started, so it's safe to leave in as long as it can find mobdebug. > 2: console.log("%s", os.time()) > 3: end, 2000) > 4: process:loop() (Obviously, you can do "local mdb = require 'mobdebug'; ...later... mdb.on()") Julien did a nice write up on a very similar situation with Xavante debugging: http://www.juliengilli.com/2013/01/03/debugging-lua-web-applications-using-zerobrane-studio-and-xavante/ I should describe this in more detail in ZBS documentation. Let me know if this is not coroutine related and I'll take further look. Paul. On Tue, Apr 9, 2013 at 2:49 PM, Ignacio Burgueño <iburgueno@xxxxxxxxx>wrote: > Ok, what an embarrassment. I hit send too soon. > > Let's try again. > > I'd like to use ZeroBrane to debug some scripts that needs LuaNode [1] to > run. LuaNode is, basically, a node.js clone. > I added a new interpreter file under the "interpreters" folder, but I > could not get it to work properly. I managed to get a debugger server > running and then I start another process that connects back to the server, > using the following script: > > ------------------------ > local mainpath = "d:/zerobranestudio/" > > package.cpath = mainpath.."bin/?.dll;"..mainpath.."bin/clibs/?.dll" > package.path = mainpath .. "/lualibs/?/?.lua;" .. > mainpath.."/lualibs/?.lua;" .. package.path > > --package.path = > "d:/zerobranestudio/bin/clibs/?/?.lua;d:/zerobranestudio/lualibs/?.lua;" .. > package.path > > package.path = > [[C:\LuaRocks\1.0\lua\?.lua;C:\LuaRocks\1.0\lua\?\init.lua;]] .. > package.path > > xpcall(function() > io.stdout:setvbuf('no') > require('mobdebug').loop('BURGUERTOP',8172) > process:loop() > end, > function(err) print(debug.traceback(err)) end) > ------------------------ > > I can then step through the script I have opened in ZeroBrane, but it > won't stop in breakpoints placed in callbacks. For example: > > 1: setInterval(function() > 2: console.log("%s", os.time()) > 3: end, 2000) > 4: process:loop() > > I can put a breakpoint at line 1, but a breakpoint in line 2 is never hit. > > Does any of the other runtimes behave similarly (use of an event loop, > etc) so I can take a look? > > Thanks in advance, > Ignacio > > >