[ZeroBrane Studio] Re: Remote debugging: IDE project path vs. actual file path

  • From: jan@xxxxxxxxxxx
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Thu, 06 Nov 2014 10:28:00 +0100

You'll need to help me here. The best way to figure out what may be
going on is to add a bit of debugging to set_breakpoint() and
has_breakpoint() functions in mobdebug and print "file" and "line"
information (something as simple as print("set", file, line) will do).

This will help to see the difference between the path being set by the
debugger and being checked when the breakpoint is supposed to be hit.

Having "debug.getinfo(1,"S").source" will be useful as well.


Alright, I did some tests and here are the results.

Just as a reminder, startup.lua starts with this code:
print("Debug.source: " .. debug.getinfo(1,"S").source)
require('mobdebug').start()
require('mobdebug').basedir([[../../scripts/]])


LOGGED RESULTS:

When having startup.lua open in ZBS AND viewing it (ONLY working case!):
--Output:
Mapped remote request for '../' to '/home/thesheeep/survivor_repo/own_projects/TwoSuns/scripts/'. Debugging session started in '/home/thesheeep/survivor_repo/own_projects/TwoSuns/scripts/'.
--Logging:
Debug.source: @../../scripts/startup.lua
Set breakpoint: rogueassembly/init.lua 13
Set breakpoint: rogueassembly/init.lua 13
Has breakpoint: startup.lua 13
Set breakpoint: rogueassembly/agents/testagent.lua 15
Has breakpoint: engine/reloadModules.lua 13
Has breakpoint: rogueassembly/test.lua 13
Has breakpoint: engine/reloadModules.lua 13
Has breakpoint: rogueassembly/actors/testactor.lua 13
Has breakpoint: rogueassembly/actors/testactor.lua 13
Has breakpoint: rogueassembly/actors/testactor.lua 15

When having startup.lua open in ZBS BUT not viewing it (instead viewing a file inside scripts/rogueassembly/):
--Output:
Debugging session started in '/home/thesheeep/survivor_repo/own_projects/TwoSuns/scripts/rogueassembly/'.
--Logging:
Debug.source: @../../scripts/startup.lua
Set breakpoint: rogueassembly/init.lua 13
Set breakpoint: init.lua 13
Set breakpoint: actors/testactor.lua 35
Has breakpoint: rogueassembly/actors/testactor.lua 39
Has breakpoint: rogueassembly/actors/testactor.lua 35
Has breakpoint: rogueassembly/actors/testactor.lua 35
Has breakpoint: rogueassembly/actors/testactor.lua 35

When having startup.lua not open at all inside ZBS (but autoactivate) and viewing the same file as above:
Same results as above.


Other related posts: