Recent

Author Topic: [SOLVED] Debug Lazarus in Lazarus  (Read 5264 times)

caleb9

  • Jr. Member
  • **
  • Posts: 51
[SOLVED] Debug Lazarus in Lazarus
« on: October 20, 2011, 11:29:38 am »
Hi,
I have some problem with my custom graphical component which is giving me an access violation error in design time. The problem is, that it's not a complete crash of the IDE, but just kind of a warning and I can click 'OK' and continue working. Trying to debug this thing I'm opening Lazarus project in Lazarus, executing it and in the 'child' Lazarus instance I open my faulty project and put the component in question on a form. The access violation error doesn't show up then... Furthermore the breakpoints I've set in the 'parent' Lazarus instance don't seem to stop the execution - my suspicion is that when I open another project in the 'child' IDE, some configuration (which is I guess common for both instances) gets overriden and breakpoints I've set for Lazarus project are not visible for the debugger anymore? Can it be so or am I talking nonsense? ;) If so, is there maybe a way to force project's instance to use completely separated path of config files etc?
I'm using FPC 2.6.0 and Lazarus from SVN revision 32993 on Mac OS X ;/.
« Last Edit: October 20, 2011, 11:46:39 am by caleb9 »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debug Lazarus in Lazarus
« Reply #1 on: October 20, 2011, 11:40:19 am »
--pcp=<config path> would force the executed Lazarus instance to look for configuration files in <config path>

caleb9

  • Jr. Member
  • **
  • Posts: 51
Re: Debug Lazarus in Lazarus
« Reply #2 on: October 20, 2011, 11:46:23 am »
Argh! a false alarm - I was opening project from a complete copy of the Lazarus directory. Now that I corrected that it stops in the breakpoints. Nevertheless it's good to know that setting, so thanks Leledumbo.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12011
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] Debug Lazarus in Lazarus
« Reply #3 on: October 20, 2011, 12:47:06 pm »
pcp is very valuable, if you have 2 or more separate installations of Lazarus. As then each installation may have different packages installed. Using the same config, would lead to get a lot of warnings, at startup, and/or trouble recompiling.

For debugging Lazarus in Lazarus you do not need pcp. I do this kind of dbg  all the time, and I do not use pcp.

Breakpoints  are stored in the project, if you save it, but overwriting that will not automatically reload them. There would be a question dialog. So you can even debug a Lazarus instance, which is debugging another Laz instance, and all with one pcp.

If you want to make changes to the config, because you debug an issue that only occurs with those changes, then I recommend making a temporary copy of your config and use pcp. the temp copy will have all the correct paths and packages to start with. Once done debugging discard it.

 

TinyPortal © 2005-2018