This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Stab string field for array types
- From: Ian Lance Taylor <ian at airs dot com>
- To: Ludovic Courtès <ludovic dot courtes at laas dot fr>
- Cc: binutils at sources dot redhat dot com, gcc at gnu dot org
- Date: 28 Mar 2003 10:51:45 -0800
- Subject: Re: Stab string field for array types
- References: <20030328103649.GE691@laas.fr>
Ludovic Courtès <ludovic dot courtes at laas dot fr> writes:
> Looking at "The Stabs Debug Format" manual, I noticed a difference
> between the description of what array types stabs should look like and
> what actually happen when compiling with GCC (2.95.4). While the manual
> states that the string field for array types should be something like
> "ar<type-number>;<lower-bound>;<upper-bound>;", gcc produces the
> following stab for "typedef int array[2];" :
>
> .stabs "array:t(0,20)=(0,21)=ar(0,1);0;1;(0,1)",128,0,1,0
>
> In other words, there seem to be another type number added after the
> last semicolon.
>
> What does this type number represent and is it a more-or-less standard
> thing?
The last type number is the type of the elements of the array. That
is, this is an array indexed by type (0,1), lower bound 0, upper bound
1, and the types of elements of the array are type (0,1).
This is documented in the version of the stabs documentation which I
have. For example ``Following the type descriptor is the type of the
index and the type of the array elements.'' The type of the index in
your example is the range type ``r(0,1);0;1''. The type of the array
element follows: ``(0,1)''.
Ian