lua-users home
lua-l archive

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


2012/9/11 Paul K <paulclinger@yahoo.com>:
> Hi Joshua,
>
>> Is there an example of hooking up the remote debugger into your own
>> application?
>
> You can start the debugger using require('mobdebug').start() or
> require('mobdebug').loop() commands. When  you use start(), the
> debugger will start debugging of the current script. When you use
> loop(), the controller can push any lua script to the client to debug;
> this is useful for those cases when you want to run in an environment
> (mobile, embedded, etc.) where you want to be able to easily change
> the scripts to work with. In this case you can also reload the script
> during debugging (this is how live coding functionality is implemented
> in ZeroBraneStudio). I have some detailed notes and examples in the
> README (https://github.com/pkulchenko/MobDebug/blob/master/examples/README).
>
>> Tilde uses a .vcproj file to describe a project folder hierarchy. That
>> project folder hierarchy is used directly by the remote debugger to resolve
>> the location of the file.  For instance, if the file on disk is
>
> MobDebug does something similar, but a bit simpler. It doesn't have
> filename mapping, but it provides "baseline" command that can be used
> to point to the project folder.
>
>> Tilde only supports debugging one master Lua state and all of its associated
>> coroutines.  Does ZeroBrane Studio support debugging more than one master
>> Lua state?
>
> I think it depends on what you mean by "more than one master state".
> It the question is about whether it can debug coroutines, then yes.
> There is require('mobdebug').coro() method you can call in your code
> to enable debugging for coroutines. You can then set breakpoints and
> step through yield/resume calls.
>
> If you mean debugging applications that use more than one lua state
> (using multiple VM instances?), then you need to enable debugging for
> each of those instances independently. You can then point them to two
> different debug servers (using different port numbers in the start()
> call); you probably won't be able to debug different VM states using
> the same backend (at least not without changing the current backend).
>
> The debugger is Lua only, so it can do everything you can do with
> debug hook in Lua. It has been tested on various versions of Windows,
> OSX, and Linux, but it should probably work anywhere as long as you
> have Lua 5.1. It can probably work with 5.2 using David's compat_env
> module [1], but I haven't tested it yet.
>
> Paul.

Hello Paul,

I am the one who posted ZBS on G+ a few days ago and I didn't realize
immediately that it was you who replied on my post. :)  I just posted
a followup question, but I guess it'd be nice if others on the list
can see my question as well, so I'll ask here too, also in case you
didn't see my G+ reply. :)

If I want to debug an embedded script, I assume that my scripts
(client scripts) have to have access to the mobdebug module right? Is
it OK if I copy mobdebug.lua file into my own project?

And is it possible to add a customizable interpreter target? I see
that you have 3 targets now in ZBS/interpreters folder. Can I come up
with one of my own program? Because I'd like to use the IDE to debug
embedded scripts in my own program, and my program uses
LuaJIT2-beta10. 

best,
Johnson