[Lazarus] tooltip debugger shows incorrect data

Joost van der Sluis joost at cnoc.nl
Sun Oct 17 12:32:19 CEST 2010


On Sun, 2010-10-17 at 14:52 +0300, Juha Manninen (gmail) wrote:
> On Sunday 17 October 2010 01:54:00 Joost van der Sluis wrote:
> 
> > I also work on a 64 but system. You're sure you used fpc 2.5.1? And
> that
> > you disabled smart-linking?

What's up with all the empty lines in your mail?

> > I used attached program to test gdb. (place breakpoint at second
> > position and do a 'p s[2]')
> Form command line it works as advertized!

No, it does not. It should show 'test'#0'string'. At least with Dwarf-3.

> arrays.pas, built with -gw, breaking gdb at line 82:
> (gdb) print s
> $1 = 0x646240 'test'
> (gdb) print s[1]
> $2 = 101 'e'

> The same built with -gw3:
> (gdb) print s
> $1 = 0x646240 'test'

ie: not good. Here it prints 'test'#0'string', as it should.

> (gdb) print s[1]
> $2 = 101 't'

> Great. So it means gdb's DWARF3 support was buggy and now it is fixed
> in Fedora package and later in others I guess.

Hmm.. somewhat. Dwarf 3 adds the ability to store dynamic arrays
properly. But stock-gdb doesn't support that properly. The problem is
that it can not handle recursive types. So an array of an array fails
miserably. 

With some help of one of the RedHat developers I've created a patch for
this. But it changes some really fundamental stuff, and the gdb-project
is seriously understaffed. So it may take a while until this get into
stock-gdb.

> Elements of arrays show correctly but the values for whole arrays
> (DynArrInt, DynArrStr, DynArrChar) still don't, although it is
> different from -gw.

Works here. I'll check on a F13 system, to be honest I still use an
older version.

> Whole static array (StatArrStr) actually shows better with -gw debug
> info.
> 
> I also created a Lazarus project from arrays.pas program, and set -gw3
> to Project Options -> Other -> Custom Options.
> 
> Works well!
> 
> The problem comes when I create a Lazarus GUI application and set -gw3
> there.
> 
> From linker:
> 
> /usr/bin/ld: warning: link.res contains output sections; did you
> forget -T?
> 
> /home/juha/SW/LazTest/xxx/lib/x86_64-linux/unit1.o: In function
> `.La1':
> 
> unit1.pas:(.debug_info+0x94): undefined reference to `DBG_FORMS_TForm'
> 
> unit1.pas:(.debug_info+0xa5): undefined reference to
> `DBG_STDCTRLS_TButton'
> 
> With -gw it works.
> 
> I also tried to compile the whole Lazarus and LCL with -gw3 and got
> similar errors.

Can you create a simple test-program that shows this behavior and post
it as a bug?

Joost





More information about the Lazarus mailing list