1

I am trying to use Remote Debugging of ZeroBrane to debug my application.

I don't want users add any extra codes to their scripts. So when a user click the debug button, at the C side, first, I set the path and call the mobdebug lib, then I try to execute the user code:

luaL_dostring(L, "package.path = package.path .. ';./scripts/lualibs/mobdebug/?.lua;./scripts/lualibs/?.lua'");
luaL_dostring(L, "package.cpath = package.cpath .. ';./scripts/bin/clibs/?.dll'");
luaL_dostring(L, "mobdebug = require('mobdebug').start()");

luaL_dofile(L, FileName);

It works fine for the official lua 5.1 intepreter. The debugger stops at line 1 of the source file. But if I switch to luajit, the zerobrane prompts "Debugging suspended at 'mobdebug.start():1' (couldn't activate the file).". Then I click "step over", the script file can be activated and the debugger stops at line 1.

Is there any way to skip the error message and directly activate the source file when using luajit?

Mixwind
  • 31
  • 3

1 Answers1

0

You may want to set debugger.runonstart = true to continue execution without stopping at the first line (documentation), but you will need to use breakpoints or Project | Break to suspend the execution when the debugging is started.

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56