Recent

Author Topic: fpdebug library  (Read 2916 times)

piola

  • Full Member
  • ***
  • Posts: 108
  • Lazarus 2.2, 64bit on Windows 8.1 x64
fpdebug library
« on: January 08, 2022, 06:34:03 pm »
Hello,

I'd like to use fpdebug with the new Lazarus 2.2 as on my system its performance is about a factor of 4 better.

However, I cannot get it to work with a library. It doesn't stop on breakpoints there. Is there something special one should know about when debugging libraries? Or can't it be done at all?

Sieben

  • Sr. Member
  • ****
  • Posts: 300
Re: fpdebug library
« Reply #1 on: January 08, 2022, 06:57:06 pm »
If you are talking about packages you'll have to choose the appropriate type of debug info in package settings (I use Dwarf3 as recommended by Martin_fr). Other than with projects the IDE doesn't issue a warning here.
Lazarus 2.2.0, FPC 3.2.2, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7892
  • Debugger - SynEdit - and more
    • wiki
Re: fpdebug library
« Reply #2 on: January 08, 2022, 09:04:55 pm »
Unfortunately libraries (dll, so) are not yet supported in the release 2.2. Work is in progress, in git main.

For this the IDE still supports the gdb based debugging.
Both debuggers should be configured in the IDE. You can choose a debugger in the project settings, so you do not need to toggle the global options all the time.

Simply for any project with libraries, switch the project settings to gdb.

piola

  • Full Member
  • ***
  • Posts: 108
  • Lazarus 2.2, 64bit on Windows 8.1 x64
Re: fpdebug library
« Reply #3 on: January 08, 2022, 09:20:14 pm »
Okay, thank you for the information. It's not a problem as gdb works quite well, just not as fast as fpdebug.

Joost

  • Newbie
  • Posts: 2
Re: fpdebug library
« Reply #4 on: January 09, 2022, 01:48:21 am »
You can use the LazFpdServerDebugger component. That one works with libraries. (See this post)

It is based on FpDebug combined with some new concepts.

And library debugging with Lazarus and GDB has one flaw: it will not stop on exceptions within the library. FpdServer (which is used by LazFpdServerDebugger in the background) has the same flaw, but I do have a rudimentary fix for it. When you are interested I can help you with it.
« Last Edit: January 09, 2022, 01:50:40 am by Joost »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7892
  • Debugger - SynEdit - and more
    • wiki
Re: fpdebug library
« Reply #5 on: January 09, 2022, 02:12:09 am »
Actually, the gdb debugger should be able to stop at all exceptions (main prg and dll).
But you have to change a setting.

Tools> Options > Debugger > Backend

IIRC:
Select the gdb debugger from the list of backends (drop down on top toolbar).
In the property grid find "InternalExceptionBrkSetMethod" and set it to "ibmName".

I haven't tested if stepping to except/finally works in all cases....

piola

  • Full Member
  • ***
  • Posts: 108
  • Lazarus 2.2, 64bit on Windows 8.1 x64
Re: fpdebug library
« Reply #6 on: January 10, 2022, 09:17:59 pm »
Select the gdb debugger from the list of backends (drop down on top toolbar).
In the property grid find "InternalExceptionBrkSetMethod" and set it to "ibmName".

This is great!! It has always been a bit distracting not being able to stop on exceptions in my library. This is of great ease to me! Thank you for that hint!

 

TinyPortal © 2005-2018