luazerobranenlua

ZeroBrane - Debugging with NLua & Visual Studio (for macOS)


Is there a way of debugging Lua scripts using ZeroBraneStudio but having the scripts loaded/initialized via NLua in C# from Visual Studio for macOS or even Windows (Not VS Code)?

The primary reason to do so is to get the CLR package interoperability included in NLua available for Lua in ZBS.

I have not been able to get the remote debugging feature found in ZBS to work with NLua. The call to require("mobdebug").start() in a Lua script does trigger a breakpoint in Visual Studio when the program is in debug mode, but no breakpoints set ZBS get triggered. Is there more configuration needed?

Please and thanks

-- UPDATE 1:

Output from line print:

BASEDIR /Users/B1313/Desktop/MyProject/
DELB * 0
SETB Modules/Test.lua 88
SETB Modules/Test.lua 94
LOAD 1272 ScriptCode/Main.lua
--[[

Solution

  • This is likely to be caused by the mismatch between the paths that the debugger gets and the paths that are set in the IDE (and used when the breakpoints are set). You may want to check the section on breakpoints in the FAQ (https://studio.zerobrane.com/doc-faq#why-breakpoints-are-not-triggered), especially items 3 and 4 on the list.