* stabs.texinfo: Clean up stuff about visibility and virtual

characters.

	* stabs.texinfo (N_M2C): Cite Sun doc.
This commit is contained in:
Jim Kingdon
1993-11-08 17:54:29 +00:00
parent 1dfaef6225
commit b857d95635
2 changed files with 53 additions and 30 deletions

View File

@ -1,3 +1,10 @@
Mon Nov 8 11:47:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* stabs.texinfo: Clean up stuff about visibility and virtual
characters.
* stabs.texinfo (N_M2C): Cite Sun doc.
Fri Nov 5 16:27:27 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) Fri Nov 5 16:27:27 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
* gdb.texinfo: updates re threads. * gdb.texinfo: updates re threads.

View File

@ -110,7 +110,7 @@ Other sources of information on stabs are @cite{Dbx and Dbxtool
Interfaces}, 2nd edition, by Sun, 1988, and @cite{AIX Version 3.2 Files Interfaces}, 2nd edition, by Sun, 1988, and @cite{AIX Version 3.2 Files
Reference}, Fourth Edition, September 1992, "dbx Stabstring Grammar" in Reference}, Fourth Edition, September 1992, "dbx Stabstring Grammar" in
the a.out section, page 2-31. This document is believed to incorporate the a.out section, page 2-31. This document is believed to incorporate
the information from those two sources except where it explictly directs the information from those two sources except where it explicitly directs
you to them for more information. you to them for more information.
@menu @menu
@ -2534,45 +2534,50 @@ pointer.
@node Protections @node Protections
@section Protections @section Protections
In the simple class definition shown above all member data and In the simple class definition shown above all member data and
functions were publicly accessable. The example that follows functions were publicly accessable. The example that follows
contrasts public, protected and privately accessable fields and shows contrasts public, protected and privately accessable fields and shows
how these protections are encoded in C++ stabs. how these protections are encoded in C++ stabs.
Protections for class member data are signified by two characters If the character following the @samp{@var{field-name}:} part of the
embedded in the stab defining the class type. These characters are string is @samp{/}, then the next character is the visibility. @samp{0}
located after the @samp{name:} part of the string. @samp{/0} means private, means private, @samp{1} means protected, and @samp{2} means public.
@samp{/1} means protected, and @samp{/2} means public. If these Debuggers should ignore visibility characters they do not recognize, and
characters are omited this means that the member is public. The assume a reasonable default (such as public) (GDB 4.11 does not, but
following C++ source: this should be fixed in the next GDB release). If no visibility is
specified the field is public. The visibility @samp{9} means that the
field has been optimized out and is public (there is no way to specify
an optimized out field with a private or protected visibility).
Visibility @samp{9} is not supported by GDB 4.11; this should be fixed
in the next GDB release.
The following C++ source:
@example @example
class all_data @{ class vis @{
private: private:
int priv_dat; int priv;
protected: protected:
char prot_dat; char prot;
public: public:
float pub_dat; float pub;
@}; @};
@end example @end example
@noindent @noindent
generates the following stab to describe the class type all_data. generates the following stab:
@display @example
.stabs "class_name:sym_desc(type)type_def(19)=type_desc(struct)struct_bytes # @r{128 is N_LSYM}
data_name:/protection(private)type_ref(int),bit_offset,num_bits; .stabs "vis:T19=s12priv:/01,0,32;prot:/12,32,8;pub:12,64,32;;",128,0,0,0
data_name:/protection(protected)type_ref(char),bit_offset,num_bits; @end example
data_name:(/num omited, private)type_ref(float),bit_offset,num_bits;;"
N_LSYM,NIL,NIL,NIL
@end display
@smallexample @samp{vis:T19=s12} indicates that type number 19 is a 12 byte structure
.stabs "all_data:t19=s12 named @code{vis} The @code{priv} field has public visibility
priv_dat:/01,0,32;prot_dat:/12,32,8;pub_dat:12,64,32;;",128,0,0,0 (@samp{/0}), type int (@samp{1}), and offset and size @samp{,0,32;}.
@end smallexample The @code{prot} field has protected visibility (@samp{/1}), type char
(@samp{2}) and offset and size @samp{,32,8;}. The @code{pub} field has
type float (@samp{12}), and offset and size @samp{,64,32;}.
Protections for member functions are signified by one digit embeded in Protections for member functions are signified by one digit embeded in
the field part of the stab describing the method. The digit is 0 if the field part of the stab describing the method. The digit is 0 if
@ -2751,14 +2756,21 @@ This additional information is embeded in the class stab following the
number of bytes in the struct. First the number of base classes number of bytes in the struct. First the number of base classes
appears bracketed by an exclamation point and a comma. appears bracketed by an exclamation point and a comma.
Then for each base type there repeats a series: two digits, a number, Then for each base type there repeats a series: a virtual character, a
a comma, another number, and a semi-colon. visibilty character, a number, a comma, another number, and a
semi-colon.
The first of the two digits is 1 if the base class is virtual and 0 if The virtual character is @samp{1} if the base class is virtual and
not. The second digit is 2 if the derivation is public and 0 if not. @samp{0} if not. The visibility character is @samp{2} if the derivation
is public, @samp{1} if it is protected, and @samp{0} if it is private.
Debuggers should ignore virtual or visibility characters they do not
recognize, and assume a reasonable default (such as public and
non-virtual) (GDB 4.11 does not, but this should be fixed in the next
GDB release).
The number following the first two digits is the offset from the start The number following the virtual and visibility characters is the offset
of the object to the part of the object pertaining to the base class. from the start of the object to the part of the object pertaining to the
base class.
After the comma, the second number is a type_descriptor for the base After the comma, the second number is a type_descriptor for the base
type. Finally a semi-colon ends the series, which repeats for each type. Finally a semi-colon ends the series, which repeats for each
@ -3481,6 +3493,10 @@ desc -> unit_number
value -> 0 (main unit) value -> 0 (main unit)
1 (any other unit) 1 (any other unit)
@end example @end example
See @cite{Dbx and Dbxtool Interfaces}, 2nd edition, by Sun, 1988, for
more information.
@end deffn @end deffn
@node N_BROWS @node N_BROWS