Recent

Author Topic: Option to make debugger's working path = build path  (Read 3420 times)

Philcha

  • Newbie
  • Posts: 3
Option to make debugger's working path = build path
« on: March 22, 2008, 01:26:11 am »
As far as I can see from docs and debugger behaviour, the debugger uses as its working directory the path of the project files. I suggest there should be an option to make the debugger use the output path specified in the project's compiler options.

I've developed with several languages and IDEs, and I never compile / build to the project path, since: what I need to back up is the source, including the project files; I can regenerate the executable any time (FPC is fast); I don't want to back up executables as that's a waste of space on the back-up medium (especially if a hypothetical crash leads to my getting a new computer, so I may need to recompile anyway).

If a program needs a pre-defined / hard-coded external resource (e.g. image), I'll place it in the build path or sub-directory of the build path; that's where it should generally be if I want to distribute the program (images etc. chosen by the user via some kind of dialog are a different matter). So the relative path in the code will be relative to the build path, not the source path.

With the debugger's present behaviour, that set-up is guaranteed to fail because the debugger calculates the physical path as relative to the project path, and therefore can't find the resource. I'm sure the problem lies with the debugger rather than my code, because I set up a sample app with 1 image as described above; it failed when run in the debugger but ran OK in stand-alone mode.

PS Sorry if this has been raised before; I tried searching this forum and got nothing I recognised as a hit.