[fpc-devel] Conditional Breakpoints using FPC and GDB

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Aug 13 11:14:19 CEST 2010


Hi,

Lazarus has a dialog for conditional breakpoints, but it doesn't work. I
tried everything.
MSEide has conditional breakpoints, but only works for integer type
expressions.

I spoke to Martin (MSEide author) and he told me that GDB doesn't
understand Pascal ansi-string expressions - hence conditional breakpoints
as follows, can never be used.

* set a breakpoint where condition is:   TypeDecl.Name = 'TRGBTriple'

The Name property doesn't have a getter function, it references the FName
field variable directly - so that annoying Pascal Properties issue with GDB
is not relevant here.


So I have to use a work-around by introducing a new temporary test variable
and a standard non-conditional breakpoint. This works, but really sucks,
because after your debugging session, you need to search for 'testvar' and
delete all code using it. :-(

    s := TypeDecl.GetDeclaration(True);
    if TypeDecl.Name = 'TRGBTriple' then
      testvar := 0;          //   <<--- set normal breakpoint here
    Writeln(EscapeText(s));

More reasons I hate FPC using GDB as a debugger instead of a native written
one.  Does anybody know if there is a way to support Conditional
Breakpoints in FPC + GDB with string types?


PS:
Anybody know how the Duby project (Object Pascal based Debugger) is
progressing, and if support for it could be added to Lazarus or MSEide?


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/




More information about the fpc-devel mailing list