From: Per Bothner Date: Fri, 4 Sep 1992 07:48:14 +0000 (+0000) Subject: * stabs.texinfo: Document the format for C++ nested types. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=621b9b0bbb8584843c7ebd39e9ef4c301e268611;p=binutils-gdb.git * stabs.texinfo: Document the format for C++ nested types. --- diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index d873cad3e16..6e3f20be329 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +Fri Sep 4 00:46:50 1992 Per Bothner (bothner@rtl.cygnus.com) + + * stabs.texinfo: Document the format for C++ nested types. + Mon Aug 24 01:17:55 1992 John Gilmore (gnu@cygnus.com) * gdbint.texinfo: Make a start at documenting all the #if macros diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index 2dda7ef3c40..b7b123f655e 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -2138,8 +2138,7 @@ ios my_ios; The relevant part of the assembly code is: @example -.stabs "'ios::io_state':T20=ebadbit:4,failbit:2,eofbit:1,goodbit:0,;",128,0,0,0 -.stabs "'ios::io_state':t20",128,0,0,0 +.stabs ":t20=ebadbit:4,failbit:2,eofbit:1,goodbit:0,;",128,0,0,0 .stabs "ios:T21=s4state:20,0,32;io_state:/220:!'ios::io_state';;",128,0,0,0 .stabs "ios:Tt21",128,0,0,0 .stabs "Fail__Fv:F20",36,0,0,_Fail__Fv @@ -2148,29 +2147,20 @@ The relevant part of the assembly code is: @end example The first line declares type 20 to be an enum. It gives it the -name @code{ios::io_state}. Single quotes surround the name, -because of the embedded @code{::}. (The name is needed when printing -the type.) +name @code{ios::io_state}. The name is suppressed because @code{io_state} +is not a globally visible name.) -The second line enters the same name into the typedef name space. -(This is useless - only @code{ios} is a real global name.) - -The third line defined the @code{ios} type. +The second line defines the @code{ios} type. The text @code{io_state:/220:!'ios::io_state';} declares that @code{io_state} is a type "member". The @code{/2} specifies public visibility, just like a regular member. This is followed by the type being defined (type 20), the magic characters @code{:!} to indicate that we're declaring a nested -type, followed by the complete name of the type (again, in single quotes). +type, followed by the complete name of the type. +Single quotes surrond the name, because of the embedded @code{::}. -Possible optimization: Replace first 3 lines by: -@example -.stabs ":T20=ebadbit:4,failbit:2,eofbit:1,goodbit:0,;",128,0,0,0 -.stabs "ios:T21=s4state:20,0,32;io_state:/220:!'ios::io_state';;",128,0,0,0 -@end example -This makes type 20 an anonymous type, until the @code{io_state} field -for type 21 is seen; that allows the debugger to back-patch the name of -type 20 to @code{ios::io_state}. +Teh debugger uses the name @code{ios::io_state} to back-patch the name +of type 20. @node Example2.c @appendix Example2.c - source code for extended example