[Lazarus] debug hints in lazarus [Re: [fpc-devel] Status and ideas about debug info (stabs, dwarf / dwar3)]

Joost van der Sluis joost at cnoc.nl
Tue Sep 13 15:01:06 CEST 2011

On Tue, 2011-09-13 at 14:07 +0200, Graeme Geldenhuys wrote:
> On 13/09/2011 00:12, Martin wrote:
> > I do not recall having ever had an issue with globals, nor local vars.
> Nope, the problem is still there... just as when I tested it back in
> 2008-2009.
>   http://opensoft.homeip.net:8080/~graemeg/gdb_issues_with_fpc.png
> This exact same code works perfectly in Delphi 7 and Kylix 3. Above is
> an old screenshot, but I just tested with latest Lazarus Trunk and GDB
> 7.3 - nothing has changed.

Ah. That problem. Luckily (?) this has nothing to do with gdb. Also any
Pascal debugger won't fix this. 

This problem exists because there is no debug-information generated for
the unit containing that global variable.

Adding a compiler option to add type and global-variables
debug-information to units, without lineinfo is on my todo list for a
long time now. That way the rtl and part of the fcl can be compiled with
this debug-info. Maybe I should spend some time on it.

> I agree with Dodi, 95% of the things I try and debug I simply get 'No
> symble in current context". Thus making GDB rather useless for my code.

The reason that this doesn't improve is that those who can fix it don't
have such problems. If you want them fixed, it's better to report when
the debug-info doesn't work for you, so it can be fixed. Rather then
assuming that it will be a
'gdb-messy-problem-which-can't-be-fixed-easily'. As it often isn't.

> I also agree, that being able to read the field variable value via the
> property name would already be a huge improvement. NOTE: I mentioned
> here "via property name", not field name, because often I don't know
> what the field name is, especially if you have a large hierarchy of objects.

This is already possible.


My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog

More information about the Lazarus mailing list