[fpc-devel] dwarf for "array [ 0..191] of "
Jonas Maebe
jonas.maebe at elis.ugent.be
Sun Jan 20 19:50:37 CET 2013
On 19 Jan 2013, at 15:17, Martin wrote:
> Since I don't know the fpc cdoebase, I can not check this myself.
>
> I suspect it is a gdb issue. But if it is not to much work, maybe someone who does know fpc dwarf generation can check that it is not fpc?
>
> I got the following source:
> type TFoo = array [0..191] of integer;
>
> and in gdb
> ptype TFoo
>
> Using dwarf, up to gdb 7.2 (inclusive) the result is ok.
>
> but 7.3 up reports
> array [0..-65] of LONGINT
>
> SO definitely something changed in GDB.
> But I do not know if the old or new gdb is right.
It looks like a gdb issue (from dwarfdump; readelf -g can show similar information):
0x00000076: TAG_array_type [4] *
AT_name( "TFOO" )
AT_byte_size( 0x00000180 )
AT_type( {0x00000091} ( SMALLINT ) )
0x00000082: TAG_subrange_type [5]
AT_lower_bound( 0x0000000000000000 )
AT_upper_bound( 0x00000000000000bf )
AT_byte_stride( 0x00000002 )
AT_type( {0x000000b0} ( BYTE ) )
0x0000008b: NULL
...
AT_name( "BYTE" )
AT_type( {0x000000ba} ( BYTE ) )
0x000000ba: TAG_base_type [7]
AT_name( "BYTE" )
AT_encoding( DW_ATE_unsigned )
AT_byte_size( 0x01 )
I.e., FPC declares the range of the array as BYTE, and BYTE is declared as an unsigned base type of 1 byte large.
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130120/d33718f8/attachment.html>
More information about the fpc-devel
mailing list