blob: 30ca7a7cc49b33295646a902ee03e81cf01e1c4a [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1992-2015 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Julia Menapace, Jim Kingdon,
and David MacKenzie.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License". -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>STABS: Basic Cplusplus Types</title>
<meta name="description" content="STABS: Basic Cplusplus Types">
<meta name="keywords" content="STABS: Basic Cplusplus Types">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Symbol-Types-Index.html#Symbol-Types-Index" rel="index" title="Symbol Types Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Cplusplus.html#Cplusplus" rel="up" title="Cplusplus">
<link href="Simple-Classes.html#Simple-Classes" rel="next" title="Simple Classes">
<link href="Nested-Symbols.html#Nested-Symbols" rel="prev" title="Nested Symbols">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Basic-Cplusplus-Types"></a>
<div class="header">
<p>
Next: <a href="Simple-Classes.html#Simple-Classes" accesskey="n" rel="next">Simple Classes</a>, Previous: <a href="Nested-Symbols.html#Nested-Symbols" accesskey="p" rel="prev">Nested Symbols</a>, Up: <a href="Cplusplus.html#Cplusplus" accesskey="u" rel="up">Cplusplus</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Basic-Types-For-C_002b_002b"></a>
<h3 class="section">8.3 Basic Types For C<tt>++</tt></h3>
<p>&lt;&lt; the examples that follow are based on a01.C &gt;&gt;
</p>
<p>C<tt>++</tt> adds two more builtin types to the set defined for C. These are
the unknown type and the vtable record type. The unknown type, type
16, is defined in terms of itself like the void type.
</p>
<p>The vtable record type, type 17, is defined as a structure type and
then as a structure tag. The structure has four fields: delta, index,
pfn, and delta2. pfn is the function pointer.
</p>
<p>&lt;&lt; In boilerplate $vtbl_ptr_type, what are the fields delta,
index, and delta2 used for? &gt;&gt;
</p>
<p>This basic type is present in all C<tt>++</tt> programs even if there are no
virtual methods defined.
</p>
<div class="display">
<pre class="display">.stabs &quot;struct_name:sym_desc(type)type_def(17)=type_desc(struct)struct_bytes(8)
elem_name(delta):type_ref(short int),bit_offset(0),field_bits(16);
elem_name(index):type_ref(short int),bit_offset(16),field_bits(16);
elem_name(pfn):type_def(18)=type_desc(ptr to)type_ref(void),
bit_offset(32),field_bits(32);
elem_name(delta2):type_def(short int);bit_offset(32),field_bits(16);;&quot;
N_LSYM, NIL, NIL
</pre></div>
<div class="smallexample">
<pre class="smallexample">.stabs &quot;$vtbl_ptr_type:t17=s8
delta:6,0,16;index:6,16,16;pfn:18=*15,32,32;delta2:6,32,16;;&quot;
,128,0,0,0
</pre></div>
<div class="display">
<pre class="display">.stabs &quot;name:sym_dec(struct tag)type_ref($vtbl_ptr_type)&quot;,N_LSYM,NIL,NIL,NIL
</pre></div>
<div class="example">
<pre class="example">.stabs &quot;$vtbl_ptr_type:T17&quot;,128,0,0,0
</pre></div>
</body>
</html>