* stabs.texinfo (Local Variable Parameters): Talk about nameless
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 7 Sep 1993 00:26:57 +0000 (00:26 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 7 Sep 1993 00:26:57 +0000 (00:26 +0000)
parameters on VAX.

gdb/doc/ChangeLog
gdb/doc/stabs.texinfo

index 5dc95aa178b75d10125515500c00bd90fff82f70..2d5cfbe90a273b222a2b6f397548757834c34cfb 100644 (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)
 
        * gdb.texinfo: @up/@down -> @raisesections/@lowersections
index da9f35a3f6be2654f9aec39866b78ad5c7648edb..e2733e07e34a1d5e8898cc5fc628e5014106f686 100644 (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
 @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}
-and the type of the @samp{@var{arg}:} symbol is @code{float}).  GCC, at
-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}
-instead of @code{N_PSYM}.  In this case, the value of the symbol
-is an offset relative to the local variables for that function, not
-relative to the arguments; on some machines those are the same thing,
-but not on all.
+and the type of the @samp{@var{arg}:} symbol is @code{float}).  
+
+GCC, at least on the 960, has another solution to the same problem.  It
+uses a single @samp{p} symbol descriptor for an argument which is stored
+as a local variable but uses @code{N_LSYM} instead of @code{N_PSYM}.  In
+this case, the value of the symbol is an offset relative to the local
+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
 @subsection Passing Parameters by Reference
This page took 0.029443 seconds and 4 git commands to generate.