[ZeroBrane Studio] Re: Debugging with multiple lua_States

  • From: Rob Probin <rob.probin@xxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Tue, 6 Oct 2015 21:57:38 +0100

Thanks, that's what I thought.

We were doing some client/server refactoring in our game, and I suggested splitting into separate lua_State for two reasons: firstly it gives a very hard split between the instances (no leaking between client and server data), secondly, this aligns with my ultimate plan to make the whole thing mildly multi-threaded by using a state per thread.

If you get any further on the threads/perspective, let me know. *Assuming* we carry on this direction over the next week I'd be willing to test, and I'd certainly pay money for this.

Regards,
Rob


On 06/10/2015 21:45, Paul K wrote:

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: