* stabs.texinfo (Local Variable Parameters): Talk about nameless

parameters on VAX.
This commit is contained in:
Jim Kingdon 1993-09-07 00:26:57 +00:00
parent 538b206806
commit f3bb0be20a
2 changed files with 37 additions and 7 deletions

View File

@ -1,3 +1,8 @@
Mon Sep 6 19:23:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* stabs.texinfo (Local Variable Parameters): Talk about nameless
parameters on VAX.
Fri Sep 3 17:06:08 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) Fri Sep 3 17:06:08 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
* gdb.texinfo: @up/@down -> @raisesections/@lowersections * gdb.texinfo: @up/@down -> @raisesections/@lowersections

View File

@ -1033,13 +1033,38 @@ Some compilers use the pair of symbols approach described above
(sometimes) when the argument type is @code{float} and it is passed as a (sometimes) when the argument type is @code{float} and it is passed as a
@code{double} and converted to @code{float} by the prologue (in the @code{double} and converted to @code{float} by the prologue (in the
latter case the type of the @samp{@var{arg}:p} symbol is @code{double} latter case the type of the @samp{@var{arg}:p} symbol is @code{double}
and the type of the @samp{@var{arg}:} symbol is @code{float}). GCC, at and the type of the @samp{@var{arg}:} symbol is @code{float}).
least on the 960, uses a single @samp{p} symbol descriptor for an
argument which is stored as a local variable but uses @code{N_LSYM} GCC, at least on the 960, has another solution to the same problem. It
instead of @code{N_PSYM}. In this case, the value of the symbol uses a single @samp{p} symbol descriptor for an argument which is stored
is an offset relative to the local variables for that function, not as a local variable but uses @code{N_LSYM} instead of @code{N_PSYM}. In
relative to the arguments; on some machines those are the same thing, this case, the value of the symbol is an offset relative to the local
but not on all. variables for that function, not relative to the arguments; on some
machines those are the same thing, but not on all.
@c This is mostly just background info; the part that logically belongs
@c here is the last sentence.
On the VAX or on other machines in which the calling convention includes
the number of words of arguments actually passed, the debugger (GDB at
least) uses the parameter symbols to keep track of whether it needs to
print nameless arguments in addition to the formal parameters which it
has printed because each one has a stab. For example, in
@example
extern int fprintf (FILE *stream, char *format, @dots{});
@dots{}
fprintf (stdout, "%d\n", x);
@end example
there are stabs for @code{stream} and @code{format}. On most machines,
the debugger can only print those two arguments (because it has no way
of knowing that additional arguments were passed), but on the VAX or
other machines with a calling convention which indicates the number of
words of arguments, the debugger can print all three arguments. To do
so, the parameter symbol (symbol descriptor @samp{p}) (not necessarily
@samp{r} or symbol descriptor omitted symbols) needs to contain the
actual type as passed (for example, @code{double} not @code{float} if it
is passed as a double and converted to a float).
@node Reference Parameters @node Reference Parameters
@subsection Passing Parameters by Reference @subsection Passing Parameters by Reference