Search code examples
luabreakpointszerobrane

ZeroBrane - breakpoint not hit


I have a following setup: LuaJIT 64bit in .NET managed, 64bit LuaSocket dll ZeroBrane 1.80; MobDebug 0.705 Then I have several Lua scripts that are to be launched on specific events and I m trying to debug it. First script - scripts/OnCreateInstance.lua also starts the MobDebug.

Debugging is working fine in this first script - debugger gets connected on require('mobdebug').start() and also following breakpoints work as expected, but breakpoints in other scripts are never hit.

I've went through the https://studio.zerobrane.com/doc-faq#why-breakpoints-are-not-triggered and haven't found anything suspicious. debug.getinfo(1,"S").source returns scripts/onstartinstance.lua and scripts/onpushbutton.lua for the second script, which is correct. I am on Windows, so case sensitivity should not apply, and when I've switched the debugger verbose, I've still never seen any info about hitting the breakpoint.

I've also tried listing all the breakpoints in the second script, and all the breakpoints are listed, they just don't hit.

Do someone have any idea, what could be the problem? My only idea is, that it could be because of the second script is run from a different thread that the first script, but that is a thing I cannot avoid and have no idea how to work it around...

Thanks for any help


Solution

  • If the project directory is set correctly and the breakpoints are not triggered from other threads (not individual Lua states), then try adding require('mobdebug').on() calls to those threads/coroutines to enable breakpoints (as described in the first option in the documentation).