You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
5.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1992-2019 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 6.4, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Cross-References (STABS)</title>
<meta name="description" content="Cross-References (STABS)">
<meta name="keywords" content="Cross-References (STABS)">
<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="Types.html#Types" rel="up" title="Types">
<link href="Subranges.html#Subranges" rel="next" title="Subranges">
<link href="Miscellaneous-Types.html#Miscellaneous-Types" rel="prev" title="Miscellaneous Types">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
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.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Cross_002dReferences"></a>
<div class="header">
<p>
Next: <a href="Subranges.html#Subranges" accesskey="n" rel="next">Subranges</a>, Previous: <a href="Miscellaneous-Types.html#Miscellaneous-Types" accesskey="p" rel="prev">Miscellaneous Types</a>, Up: <a href="Types.html#Types" accesskey="u" rel="up">Types</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="Cross_002dReferences-to-Other-Types"></a>
<h3 class="section">5.3 Cross-References to Other Types</h3>
<p>A type can be used before it is defined; one common way to deal with
that situation is just to use a type reference to a type which has not
yet been defined.
</p>
<p>Another way is with the &lsquo;<samp>x</samp>&rsquo; type descriptor, which is followed by
&lsquo;<samp>s</samp>&rsquo; for a structure tag, &lsquo;<samp>u</samp>&rsquo; for a union tag, or &lsquo;<samp>e</samp>&rsquo; for
a enumerator tag, followed by the name of the tag, followed by &lsquo;<samp>:</samp>&rsquo;.
If the name contains &lsquo;<samp>::</samp>&rsquo; between a &lsquo;<samp>&lt;</samp>&rsquo; and &lsquo;<samp>&gt;</samp>&rsquo; pair (for
C<tt>++</tt> templates), such a &lsquo;<samp>::</samp>&rsquo; does not end the name&mdash;only a single
&lsquo;<samp>:</samp>&rsquo; ends the name; see <a href="Nested-Symbols.html#Nested-Symbols">Nested Symbols</a>.
</p>
<p>For example, the following C declarations:
</p>
<div class="example">
<pre class="example">struct foo;
struct foo *bar;
</pre></div>
<p>produce:
</p>
<div class="example">
<pre class="example">.stabs &quot;bar:G16=*17=xsfoo:&quot;,32,0,0,0
</pre></div>
<p>Not all debuggers support the &lsquo;<samp>x</samp>&rsquo; type descriptor, so on some
machines GCC does not use it. I believe that for the above example it
would just emit a reference to type 17 and never define it, but I
haven&rsquo;t verified that.
</p>
<p>Modula-2 imported types, at least on AIX, use the &lsquo;<samp>i</samp>&rsquo; type
descriptor, which is followed by the name of the module from which the
type is imported, followed by &lsquo;<samp>:</samp>&rsquo;, followed by the name of the
type. There is then optionally a comma followed by type information for
the type. This differs from merely naming the type (see <a href="Typedefs.html#Typedefs">Typedefs</a>) in
that it identifies the module; I don&rsquo;t understand whether the name of
the type given here is always just the same as the name we are giving
it, or whether this type descriptor is used with a nameless stab
(see <a href="String-Field.html#String-Field">String Field</a>), or what. The symbol ends with &lsquo;<samp>;</samp>&rsquo;.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Subranges.html#Subranges" accesskey="n" rel="next">Subranges</a>, Previous: <a href="Miscellaneous-Types.html#Miscellaneous-Types" accesskey="p" rel="prev">Miscellaneous Types</a>, Up: <a href="Types.html#Types" accesskey="u" rel="up">Types</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>
</body>
</html>