Recent

Author Topic: Debugging Lazarus using Lazarus?  (Read 2484 times)

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Debugging Lazarus using Lazarus?
« on: April 22, 2014, 06:01:46 pm »
Hi gurus,
I am a newbie here.



I am developing a new TDesignerMediator (based on Laz Examples) & a project template.
So far I can create a new project, adding few widget, and it run (F9) nicely.


My problem is : Lazarus hang when I delete a component in its designer, or (sometime) when reload that project, and also hang when I start Lazarus and Lazarus is trying to reopen that last project automatically.
I think I need to debug Lazarus (using Lazarus), can I Debug Lazarus using Lazarus it self? How ?


I want to know whats going on since the last error reported by Lazarus is only "Access Violation"...
which is meaningless.


Any pointer / advice would be appreciated.
Thanks.


Regards,
x2nie

When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debugging Lazarus using Lazarus?
« Reply #1 on: April 22, 2014, 06:29:10 pm »
Quote
can I Debug Lazarus using Lazarus it self? How ?
Better to have separate lazarus executables (clean one + your addition) and open lazarus lpi (in ide folder) using the clean one to debug your addition. Otherwise it's also possible to debug from terminal.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: Debugging Lazarus using Lazarus?
« Reply #3 on: April 22, 2014, 06:34:30 pm »
I think I need to debug Lazarus (using Lazarus), can I Debug Lazarus using Lazarus it self? How ?

First build Lazarus with debug info from Tools menu.
Then open project ide/lazarus.lpi. Run it (F9). Now you can debug it like any other project. You have windows open from 2 Lazarus instances, pay attention which windows belong to the new debugged instance.

Another option for debugging is to use GDB from cmd line.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Debugging Lazarus using Lazarus?
« Reply #4 on: April 23, 2014, 08:32:21 am »
Yes!
Thanks you Leledumbo, JuhaManninen.. I could debug lazarus using another instance of Lazarus.
Thanks you Martin_fr for the link.


For debugging using GDB/command line, I didn't try it yet. I just satisfied with the first option. I would ask when it needed, perhaps later.




And my problem solved:
The DesignerMediator trying to paint the widget that is csDestroying ComponentState. Without debugging, I have no chance to know which line the error occurs.


Thanks you very much guru!


Regards,
x2nie
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

 

TinyPortal © 2005-2018