Recent

Author Topic: Debugger do not find executable - customed directories layout  (Read 7583 times)

thierrybo

  • Full Member
  • ***
  • Posts: 143
Debugger do not find executable - customed directories layout
« on: November 16, 2009, 10:35:01 am »
Hi,

I usually have no problem using debugger. However today I tried to use this folder layout :

- Project

--- bin

----- debug
----- release

--- src

--- units

----- debug
----- release

Lazarus project files are in /src/

To get exe files in /bin/debug/ and other files in /units/debug/ I set units output directory to ..\units\debug in path tab (picture1) and directory for compiled program to -FE..\bin\debug\ in custom options of Other tab (see picture 2).

The resulting command line option is

Code: [Select]
-FU..\units\debug\ -FE..\units\debug\ -oproject1.exe -FE..\bin\debug
The second -FE switch  override the first one (added automatically by Lazarus if we fill the units output directory). This work fine if  I build the program but it does not if I want to run it for debugging. With such configuration, i get :

Quote
no program file "C:\project\units\debug\project1.exe" found


Debugger does not look for the compiled program in /bin/ folder but in /units/. I tried to move the units output directory from the path tab to the custom options :

Code: [Select]
-FE..\bin\debug\
-FU..\units\debug\

but this time I get:

Quote
no program file "C:\project\src\project1.exe" found

This time the debugger look for the compiled program in /src/ folder. I would like to know if I missed some options or if I can submit a bug report.

thierrybo

  • Full Member
  • ***
  • Posts: 143
Re: Debugger do not find executable - customed directories layout
« Reply #1 on: November 16, 2009, 10:41:56 am »
I found a way to solve this :

Units output path in path tab to :

..\bin\debug

and NOT to the units path, as it seems Lazarus only use the path set here for looking the compiled program when debugging.

then in custom option I override this path :

-FU..\units\debug\

« Last Edit: November 16, 2009, 10:44:23 am by thierrybo »

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Debugger do not find executable - customed directories layout
« Reply #2 on: November 16, 2009, 11:18:59 am »
Try setting the Target file name (including path) in the Project Options.

thierrybo

  • Full Member
  • ***
  • Posts: 143
Re: Debugger do not find executable - customed directories layout
« Reply #3 on: November 16, 2009, 06:46:02 pm »
Thanks,

I tested your solution, even with a relative path and it works:

  • Target file name in the Project Options :
Code: [Select]
../bin/debug/project1

  • Units output directory in path tab :
Code: [Select]
../units/debug
  • Nothing in custom options

and resulting compiler options:

Code: [Select]
-FU../units/debug/ -FE../bin/debug/ -oproject1
With mine the resulting compiler options are:

Code: [Select]
-FU../bin/debug/ -FE../bin/debug/ -oproject1 -FU../units/debug/
However I think I will keep mine because I look for a generic set of options that I can quickly switch to with the load compiler option window. With yours, each time I have to load a compiler profile, I have also to change path in Project Options (at least as far as the Target file name in the Project Options is not saved with compiler options) .

There is however a small drawback with my solution, the project1.compiled file keeps being created in /bin/ folder, not in /units/ one.
« Last Edit: November 16, 2009, 06:49:14 pm by thierrybo »

 

TinyPortal © 2005-2018