Stab string field for array types

Ian Lance Taylor ian@airs.com
Fri Mar 28 19:55:00 GMT 2003


Ludovic Courtès <ludovic.courtes@laas.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



More information about the Binutils mailing list