Recent

Author Topic: Debug into FPC source?  (Read 4710 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
Debug into FPC source?
« on: March 21, 2013, 05:38:19 pm »
Hi,
Is it possible to debug into the FPC source?
I.E.  if I put a breakpoint in the DB unit for example, it never stops and I can even
change a method name to force a error and nothing happens?

In Delphi I could debug into the VCL source, is there a way to do that in Lazarus with the FCL source?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debug into FPC source?
« Reply #1 on: March 21, 2013, 05:54:21 pm »
Quote
Is it possible to debug into the FPC source?
Yes, rebuild the unit(s) with debug info.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Debug into FPC source?
« Reply #2 on: March 21, 2013, 07:41:55 pm »
The FPC install in lazarus is pre build (rtl/ fpc-packages). The IDE does never rebuild them.

To rebuild them you need the fpc makefiles (which aren't included in the Lazarus installer (at least not the one for windows)

You need to download an fpc source distribution, and rebuild yourself.
    google "fpc buildfaq"
and read it.

Another option is to make a copy of the one package (from the fpc sources that come with lazarus).
Create a lazarus package, and use that.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Debug into FPC source?
« Reply #3 on: March 21, 2013, 09:35:43 pm »
What Martin said, or use e.g. fpcup to build install a separate copy of fpc+Lazarus. Pass --fpcopt="-g -gl" and --lazopt="-g -gl" (or whatever debug options you want; please fpcup --help for details)

:)

Link: see bitbucket site, see fpcup repository, download
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debug into FPC source?
« Reply #4 on: March 22, 2013, 10:04:23 am »
Quote
To rebuild them you need the fpc makefiles (which aren't included in the Lazarus installer (at least not the one for windows)
AFAIR it's there, but not in single makefile for both rtl and packages. There's one inside each directory.

 

TinyPortal © 2005-2018