Recent

Author Topic: [SOLVED] Debugging in an LPK  (Read 214 times)

CM630

  • Hero Member
  • *****
  • Posts: 1019
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[SOLVED] Debugging in an LPK
« on: November 11, 2022, 01:27:41 pm »
I am trying to debug code, which is included in an LPK.
When I create a breakpoint it is shown with a question mark within it, as usual, but when I run the app using the source from the LPK the breakpoint changes to a circle with a X in it and the program does not stop on the marked lines. Is it possible, to enable debugging in these cases?
« Last Edit: November 11, 2022, 03:06:51 pm by CM630 »
Лазар 2,2,4 32 bit; FPC3,2,2; rev: Lazarus_2_2_4 on W10 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 12620
Re: Debugging in an LPK
« Reply #1 on: November 11, 2022, 01:32:49 pm »
Yes as long as the LPK is compiled with debug information and your host app that uses the package too.
It may be that your LPK is release compiled and has no debug info. You have to enable the debug info and recompile the package.
It may be that your host app suffers the same issue. In that case it can't jump to the lpk information.
« Last Edit: November 11, 2022, 01:37:15 pm by Thaddy »
The only thing I can say about Putin - born st Petersburg- is that he is indeed Russian, as opposed to Stalin, who was Georgian. Depending of historical time frame they could both be Lithuanian or Polish...even German. Shut him up!

CM630

  • Hero Member
  • *****
  • Posts: 1019
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Debugging in an LPK
« Reply #2 on: November 11, 2022, 02:06:51 pm »
I have opened the LPK.

Compilation and Linking/Optimization levels = 1.
Debugging/Check and assertion = everything is checked.

I have changed Compilation and Linking/Optimization levels = 0, then I did Install.

Still the breakpoints do not work.
« Last Edit: November 11, 2022, 03:04:56 pm by CM630 »
Лазар 2,2,4 32 bit; FPC3,2,2; rev: Lazarus_2_2_4 on W10 64bit.

wp

  • Hero Member
  • *****
  • Posts: 10479
Re: Debugging in an LPK
« Reply #3 on: November 11, 2022, 02:36:51 pm »
In the project options, go to "Compiler Options" > "Additions and overrides". Click on "Stored in session of project (.lps)", then "Add" > "Custom Option", click on "Targets" > "Custom" and type "-gw3" (without quotes") > "OK". (You could also put this into "Stored in project (.lpi)", but my personal opinion is that this is a local setting and should not be in the project file).

When you now compile the project, the IDE recompiles also all packages with Dwarf-3 debug information.

CM630

  • Hero Member
  • *****
  • Posts: 1019
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: [SOLVED] Debugging in an LPK
« Reply #4 on: November 11, 2022, 03:07:12 pm »
Thanks, that did it!
Лазар 2,2,4 32 bit; FPC3,2,2; rev: Lazarus_2_2_4 on W10 64bit.

 

TinyPortal © 2005-2018