[ZeroBrane Studio] Re: Debugging with multiple lua_States

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Tue, 6 Oct 2015 13:45:49 -0700

Hi Rob,

What happens if I have three lua_States in one application?

Only one can be debugged; the first one to connect will start the
debugging session and all the others will be rejected with a message
that there is a debugging session already in progress.

Do I need to do the require('mobdebug').start() in the specific lua_State I
want to debug?

Yes, but it's likely not going to work (for reasons described above).
You can run different sessions on different ports, but you'd need
different instances of ZBS listening on those ports as described here:
https://studio.zerobrane.com/doc-faq#how-do-i-start-two-zerobrane-studio-instances-to-debug-two-applications-at-the-same-time

Do things change if each one is on a separate thread?

If you mean "real" threads, not coroutines, then the answer is no, as
those will probably require their own lua states.

Just a quick note related to this topic: I'm working on an extension
that is expected to support this from one instance with a UI
customized to switch between threads/perspectives, but it's still
largely work-in-progress and is planned to be provided as a ZBS
extension on a commercial basis (with a different license).

Paul.

On Tue, Oct 6, 2015 at 1:36 PM, Rob Probin <rob.probin@xxxxxxxxx> wrote:
Hi,

What happens if I have three lua_States in one application?

Do I need to do the require('mobdebug').start() in the specific lua_State I
want to debug?

Do things change if each one is on a separate thread?

Regards,
Rob




Other related posts: