www.delorie.com/gnu/docs/gdb/stabs_23.html   search  
Buy the book!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6 Fortran Based Variables

Fortran (at least, the Sun and SGI dialects of FORTRAN-77) has a feature which allows allocating arrays with malloc, but which avoids blurring the line between arrays and pointers the way that C does. In stabs such a variable uses the `b' symbol descriptor.

For example, the Fortran declarations

real foo, foo10(10), foo10_5(10,5)
pointer (foop, foo)
pointer (foo10p, foo10)
pointer (foo105p, foo10_5)

produce the stabs


In this example, real is type 6 and type 3 is an integral type which is the type of the subscripts of the array (probably integer).

The `b' symbol descriptor is like `V' in that it denotes a statically allocated symbol whose scope is local to a function; see See section 4.5 Static Variables. The value of the symbol, instead of being the address of the variable itself, is the address of a pointer to that variable. So in the above example, the value of the foo stab is the address of a pointer to a real, the value of the foo10 stab is the address of a pointer to a 10-element array of reals, and the value of the foo10_5 stab is the address of a pointer to a 5-element array of 10-element arrays of reals.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003