paulclinger

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Debugging Support for Lua #32099
    paulclinger
    Participant
      • Topics: 0
      • Replies: 2
      • Total: 2

      I was able to start debugging at any time and saw the code break in Zerobrane. I wasnt able to detach the debugger though. I think I tried require(‘mobdebug’).done() but it was crashing Ctrlr. I ll try it out once more and let you know.

      If detaching still doesn’t work, you may try with MobDebug from 0.90 version of ZBS (should be v. 0.607+). There were some fixes for detaching that may help in your case as well.

      Paul.

      in reply to: Debugging Support for Lua #32034
      paulclinger
      Participant
        • Topics: 0
        • Replies: 2
        • Total: 2

        require(‘mobdebug’).start()

        function testme() <----------------------- right here console("testme() called") console("Step 1") console("Step 2") end[/quote] @synth, if I may offer a suggestion: you don't need to run start() at the beginning of the script if it interferes with your compilation. You can run it at any point and it will start the debugging correctly. It seems like in this case you can simply move it inside testme() function and the debugging will start only when you call testme from the console. > So it seems that I need to open the mobdebug.lua file in Ctrlr as well as my Test.lua file. Then I need to switch my project directory in Zerobrane to the one which has Test.lua

        This may be fixed by moving the start() call into the testme() function as well. You’d only need to set the project directory to whatever directory this file you are debugging is in.

        Also, I don’t expect you’d need to make changes to mobdebug as requiring “os” is behind pcall; this was done specifically to support the environments that may not have “os” module at all. Was it not working for you?

        There is one more call that may help in your case. Since start() sets a debug hook and the hook is not removed until the debugging is done, it may interfere with some other Lua code you have in your framework. You can temporarily disable debugging using on()/off() calls or completely stop the debugging using done() call. So, in the case above:

        function testme()
        require(‘mobdebug’).start() —<-- start debugging console("testme() called") console("Step 1") console("Step 2") require('mobdebug').done() --<-- stop/complete debugging end Obviously breakpoints and stepping will only work while the debugging is enabled. Let me know if you can't get it to work and I'll try to help. Paul.

      Viewing 2 posts - 1 through 2 (of 2 total)
      Ctrlr