From 6ea34847c6dbc33d13467be0453018c95f354f26 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Fri, 30 Jul 1993 23:31:14 +0000 Subject: [PATCH] * stabs.texinfo (Procedures): Improve stuff on nested functions. --- gdb/doc/ChangeLog | 4 ++++ gdb/doc/stabs.texinfo | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a6cd43bab25..d1c214be0d2 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +Fri Jul 30 18:26:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * stabs.texinfo (Procedures): Improve stuff on nested functions. + Thu Jul 29 15:10:58 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) * remote.texi: (MIPS Remote) clearer doc for set/show timeout, diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index 624be71055a..09083eb1772 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -528,12 +528,39 @@ type information. For any of the above symbol descriptors, after the symbol descriptor and the type information, there is optionally a comma, followed by the name of the procedure, followed by a comma, followed by a name specifying the -scope. The first name is local to the scope specified. I assume then -that the name of the symbol (before the @samp{:}), if specified, is some -sort of global name. I assume the name specifying the scope is the name -of a function specifying that scope. This feature is an AIX extension, -and this information is based on the manual; I haven't actually tried -it. +scope. The first name is local to the scope specified, and seems to be +redundant with the name of the symbol (before the @samp{:}). The name +specifying the scope is the name of a procedure specifying that scope. +This feature is used by @sc{gcc}, and presumably Pascal, Modula-2, etc., +compilers, for nested functions. + +If procedures are nested more than one level deep, only the immediately +containing scope is specified, for example: + +@example +int +foo (int x) +@{ + int bar (int y) + @{ + int baz (int z) + @{ + return x + y + z; + @} + return baz (x + 2 * y); + @} + return x + bar (3 * x); +@} +@end example + +@noindent +produces the stabs: + +@example +.stabs "baz:f1,baz,bar",36,0,0,_baz.15 # 36 == N_FUN +.stabs "bar:f1,bar,foo",36,0,0,_bar.12 +.stabs "foo:F1",36,0,0,_foo +@end example The stab representing a procedure is located immediately following the code of the procedure. This stab is in turn directly followed by a -- 2.30.2