[Lazarus] Debugging libraries which define generics.

Martin Frb lazarus at mfriebe.de
Fri Dec 15 19:29:23 CET 2017


On 15/12/2017 15:46, Donald Ziesig via Lazarus wrote:
>
> Hi All,
>
> I have been working on some *serious* :-$ software libraries that 
> declare generic subprograms and classes.
>
> While debugging these I noticed:
>
>  1. When single-stepping, the line being highlighted in the editor
>     window is almost always (but not exclusively) one line *after* the
>     line which is about to be executed.
>
This may be an issue in fpc.

IIRC
{$IFDEF unknownfoo}
  'unclosed string
{$ENDIF}
may also lead to wrong line info

>  1. When the mouse hovers over a variable, the debugger (and program
>     being debugged) frequently crashes with the error:
>     "-data-evaluate-expression TCQPiece(ITEM)^" did not return any result.
>     This is particularly annoying because it inevitably happens just
>     as I am getting close to finding a problem and I move the mouse
>     across the editor window :'(.
>
> These problems do not occur when debugging non-generic code.
>
This is an issue in gdb.

First make sure to use dward (debug info).
This must be done for ALL packages too (well all packages that have 
debug info).

But even then you will probably get this error.

You can try (if it currently compiles / its a package, install it) 
lazdebuggerfpgdbmi.lpk  (must be the one with gdbmi *and* fp)
And then change the debugger in Tools > Options

I dont know how good it will be....

----------
Also switch of the hint in the options, and use the watch window only. 
that way you can control which values you look at.

--------
you may also try an older gdb (pre 7.6). But again not likely to help 
too much.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171215/aca9862e/attachment-0001.html>


More information about the Lazarus mailing list