[ZeroBrane Studio] Re: Problems setting up debugging

  • From: Tim Mensch <tim-freelists@xxxxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Fri, 28 Jun 2013 15:08:41 -0600

Hi Paul,

That helped, but wasn't QUITE enough to make it work. It was enough for me to track down where to look for the problem, though.

It turns out that my path is being passed back as "lua/init.lua", including the quotes, and so when I hit Step, it would open up an untitled buffer with the text "lua/init.lua". It interpreted the text as a serialized Lua file, in other words, and not as a file name that needed a basedir.

I was able to track down where the path was getting messed up in debugger.lua. Looking at the code, basedir may have only worked if the filename wasn't included in quotes. From there it was a simple matter of checking to see if the file exists given basedir, and without the quotes. I'm sending off a pull request (cherry picked and applied to a branch off of master, as you asked) now.

Tim

On 6/27/2013 6:34 PM, Paul K wrote:
Hi Tim,

My internal paths are potentially a problem. I do all of my loading through paths 
relative to the "assets" folder, but run the game with the folder set to the 
executable folder. So ZeroBrane doesn't have a way to know what file matches what path.
You are right; this is most likely the reason. In most cases, you can
fix it by setting project directory to whatever directory you load
your files relative to, but if you need to start your project in one
directory, but load files relative to some other directory, you need
to use another mechanism.

Any way I can give it a hint? Or is there likely some other problem?
Yes, if you are using your own interpreter, you can specify what
directory will be used as the base directory for debugging. You can
pass "basedir" parameter to DebuggerAttachDefault() method that will
instruct the debugger to ignore project directory and will set basedir
based on the value you pass. You can calculate it any way you need
based on you project structure. You can check lfw.lua and
marmalade.lua in interpreters/ folder for some examples.

Let me know if that helps.

Paul.

On Thu, Jun 27, 2013 at 5:21 PM, Tim Mensch <tim-freelists@xxxxxxxxxxx> wrote:
Hi,

I just got mobdebug.lua to finally run happily in my engine, but it's not
actually ever stopping at a breakpoint. :|

If I disable "runonstart", it gets completely stuck. If I enable
"runonstart", it happily runs, but then never sees any breakpoints.

My internal paths are potentially a problem. I do all of my loading through
paths relative to the "assets" folder, but run the game with the folder set
to the executable folder. So ZeroBrane doesn't have a way to know what file
matches what path. Any way I can give it a hint? Or is there likely some
other problem?

Thanks in advance,

Tim



Other related posts: