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

  • From: jan@xxxxxxxxxxx
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Wed, 22 Oct 2014 14:17:01 +0200

Alright, thanks to your help, I got the debugging server running and it detects the starting of the program correctly.


Almost there!

However, no breakpoints are working. I had a look at the FAQ and it seems that this is the problem: "You may be using your own Lua engine that doesn’t report file names relative to the project directory (as set in the IDE). For example, you set the project directory pointing to scripts folder (with common subfolder) and the engine reports the file name as myfile.lua instead of common/myfile.lua; the IDE will be looking for scripts/myfile.lua instead of scripts/common/myfile.lua and the file will not be activated and the breakpoints won’t work. You may also be using inconsistent path separators in the file names; for example, common/myfile.lua in one case and common\myfile.lua in another."

While this helped me figure out the problem, I have not the slightest idea about how to solve it. It might be a good idea to add that to the FAQ ;)

In my case, the folder structure is like this:

- gamedir
  - scripts    // This is where all scripts are
  - bin
- release_win (or another platform) // This is where the executable lies, it is also the working directory

So, with this in mind, here is what print(debug.getinfo(1,"S").source) shows:
@../../scripts/rogueassembly\init.lua
It goes up two folders from the working dir, then into the scripts folder, etc. Looking fine, I would say (except that / and \ mix, which I don't know where it comes from, probably Windows).

Now, in ZBS, I have set the scripts folder as the project directory. So ZBS expects rogueassembly/init.lua (I guess).

My guess is I would need some way to specify a custom file naming scheme so that ZBS knows files can be prefixed with something and may (or may not, for example on Linux) contain \ instead of /. However, neither in the FAQ nor in the remote debugging help, I found any clue in how I could solve this little problem.


Other related posts: