[Lazarus] tooltip debugger shows incorrect data
Juha Manninen (gmail)
juha.manninen62 at gmail.com
Sun Oct 17 16:20:04 CEST 2010
On Sunday 17 October 2010 13:32:19 Joost van der Sluis wrote:
> What's up with all the empty lines in your mail?
?
I don't see many empty lines.
> > 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'
Ok, you got me. I was only interested in this one char, ignored the rest and
faked (copied) the output. Bad, sorry.
> > 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.
Many projects seem to be understaffed.
> > 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 copy here gdb's output when braking at line 82.
With -gw:
-----------
(gdb) p DynArrInt
$1 = 0x7ffff7fd6050
(gdb) p DynArrStr
$2 = 0x7ffff7fee0d0
(gdb) p DynArrChar
$3 = 0x7ffff7fe6090
(gdb) p StatArrStr
$4 = {0x7ffff7fde0d0 'str0', 0x7ffff7fde110 'str1', 0x7ffff7fde150 'str2',
0x7ffff7fde190 'str3', 0x7ffff7fde1d0 'str4', 0x7ffff7fde210 'str5', 0x7ffff7fde250
'str6', 0x7ffff7fde290 'str7', 0x7ffff7fde2d0 'str8',
0x7ffff7fde310 'str9', 0x7ffff7fde350 'str10', 0x7ffff7fde390 'str11',
0x7ffff7fde3d0 'str12'}
(gdb)
With -gw3 (no faking):
--------------------------
(gdb) p DynArrInt
$1 = '23456789:;<=>'
(gdb) p DynArrStr
$2 = {'�����'#127#0#0'0���', '�'#127#0#0'p����'#127#0, '�����'#127#0#0'����',
'�'#127#0#0'0����'#127#0, 'p����'#127#0#0'����', '�'#127#0#0'�����'#127#0,
'0����'#127#0#0'p���', '�'#127#0#0'�����'#127#0,
'�����'#127#0#0#129#128#19}
(gdb) p DynArrChar
$3 = 'abcdefghijklm'
(gdb) p StatArrStr
$4 = {'����', '�'#127#0, #16'���', '�'#127#0, 'P���', '�'#127#0, #144'���',
'�'#127#0, '����', '�'#127#0, #16'���', '�'#127#0, 'P���', '�'#127#0,
#144'���', '�'#127#0, '����', '�'#127#0, #16'���', '�'#127#0, 'P���',
'�'#127#0, #144'���', '�'#127#0, '����'}
(gdb) p s
$5 = 'test'#0'string'
(gdb) p s[1]
$6 = 116 't'
(gdb)
> > The problem comes when I create a Lazarus GUI application and set -gw3
> > there.
[Snip]
> Can you create a simple test-program that shows this behavior and post
> it as a bug?
Done:
#17651: Lazarus application fails to link when built with -gw3
Regards,
Juha
More information about the Lazarus
mailing list