386 lines
9.4 KiB
HTML
386 lines
9.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of C++FILT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>C++FILT</H1>
|
|
Section: GNU Development Tools (1)<BR>Updated: 2021-01-21<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
c++filt - demangle C++ and Java symbols
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
c++filt [<B>-_</B>|<B>--strip-underscore</B>]
|
|
<BR> [<B>-n</B>|<B>--no-strip-underscore</B>]
|
|
<BR> [<B>-p</B>|<B>--no-params</B>]
|
|
<BR> [<B>-t</B>|<B>--types</B>]
|
|
<BR> [<B>-i</B>|<B>--no-verbose</B>]
|
|
<BR> [<B>-r</B>|<B>--no-recurse-limit</B>]
|
|
<BR> [<B>-R</B>|<B>--recurse-limit</B>]
|
|
<BR> [<B>-s</B> <I>format</I>|<B>--format=</B><I>format</I>]
|
|
<BR> [<B>--help</B>] [<B>--version</B>] [<I>symbol</I>...]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The C<FONT SIZE="-2">++</FONT> and Java languages provide function overloading, which means
|
|
that you can write many functions with the same name, providing that
|
|
each function takes parameters of different types. In order to be
|
|
able to distinguish these similarly named functions C<FONT SIZE="-2">++</FONT> and Java
|
|
encode them into a low-level assembler name which uniquely identifies
|
|
each different version. This process is known as <I>mangling</I>. The
|
|
<B>c++filt</B>
|
|
[1]
|
|
program does the inverse mapping: it decodes (<I>demangles</I>) low-level
|
|
names into user-level names so that they can be read.
|
|
<P>
|
|
|
|
Every alphanumeric word (consisting of letters, digits, underscores,
|
|
dollars, or periods) seen in the input is a potential mangled name.
|
|
If the name decodes into a C<FONT SIZE="-2">++</FONT> name, the C<FONT SIZE="-2">++</FONT> name replaces the
|
|
low-level name in the output, otherwise the original word is output.
|
|
In this way you can pass an entire assembler source file, containing
|
|
mangled names, through <B>c++filt</B> and see the same source file
|
|
containing demangled names.
|
|
<P>
|
|
|
|
You can also use <B>c++filt</B> to decipher individual symbols by
|
|
passing them on the command line:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
c++filt <symbol>
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
If no <I>symbol</I> arguments are given, <B>c++filt</B> reads symbol
|
|
names from the standard input instead. All the results are printed on
|
|
the standard output. The difference between reading names from the
|
|
command line versus reading names from the standard input is that
|
|
command-line arguments are expected to be just mangled names and no
|
|
checking is performed to separate them from surrounding text. Thus
|
|
for example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
c++filt -n _Z1fv
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
will work and demangle the name to ``f()'' whereas:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
c++filt -n _Z1fv,
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
will not work. (Note the extra comma at the end of the mangled
|
|
name which makes it invalid). This command however will work:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
echo _Z1fv, | c++filt -n
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
and will display ``f(),'', i.e., the demangled name followed by a
|
|
trailing comma. This behaviour is because when the names are read
|
|
from the standard input it is expected that they might be part of an
|
|
assembler source file where there might be extra, extraneous
|
|
characters trailing after a mangled name. For example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
.type _Z1fv, @function
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-_</B><DD>
|
|
|
|
|
|
|
|
<DT id="2"><B>--strip-underscore</B><DD>
|
|
|
|
|
|
|
|
On some systems, both the C and C<FONT SIZE="-2">++</FONT> compilers put an underscore in front
|
|
of every name. For example, the C name <TT>"foo"</TT> gets the low-level
|
|
name <TT>"_foo"</TT>. This option removes the initial underscore. Whether
|
|
<B>c++filt</B> removes the underscore by default is target dependent.
|
|
<DT id="3"><B>-n</B><DD>
|
|
|
|
|
|
|
|
<DT id="4"><B>--no-strip-underscore</B><DD>
|
|
|
|
|
|
|
|
Do not remove the initial underscore.
|
|
<DT id="5"><B>-p</B><DD>
|
|
|
|
|
|
|
|
<DT id="6"><B>--no-params</B><DD>
|
|
|
|
|
|
|
|
When demangling the name of a function, do not display the types of
|
|
the function's parameters.
|
|
<DT id="7"><B>-t</B><DD>
|
|
|
|
|
|
|
|
<DT id="8"><B>--types</B><DD>
|
|
|
|
|
|
|
|
Attempt to demangle types as well as function names. This is disabled
|
|
by default since mangled types are normally only used internally in
|
|
the compiler, and they can be confused with non-mangled names. For example,
|
|
a function called ``a'' treated as a mangled type name would be
|
|
demangled to ``signed char''.
|
|
<DT id="9"><B>-i</B><DD>
|
|
|
|
|
|
|
|
<DT id="10"><B>--no-verbose</B><DD>
|
|
|
|
|
|
|
|
Do not include implementation details (if any) in the demangled
|
|
output.
|
|
<DT id="11"><B>-r</B><DD>
|
|
|
|
|
|
|
|
<DT id="12"><B>-R</B><DD>
|
|
|
|
|
|
<DT id="13"><B>--recurse-limit</B><DD>
|
|
|
|
|
|
<DT id="14"><B>--no-recurse-limit</B><DD>
|
|
|
|
|
|
<DT id="15"><B>--recursion-limit</B><DD>
|
|
|
|
|
|
<DT id="16"><B>--no-recursion-limit</B><DD>
|
|
|
|
|
|
|
|
Enables or disables a limit on the amount of recursion performed
|
|
whilst demangling strings. Since the name mangling formats allow for
|
|
an inifinite level of recursion it is possible to create strings whose
|
|
decoding will exhaust the amount of stack space available on the host
|
|
machine, triggering a memory fault. The limit tries to prevent this
|
|
from happening by restricting recursion to 2048 levels of nesting.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is for this limit to be enabled, but disabling it may be
|
|
necessary in order to demangle truly complicated names. Note however
|
|
that if the recursion limit is disabled then stack exhaustion is
|
|
possible and any bug reports about such an event will be rejected.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-r</B> option is a synonym for the
|
|
<B>--no-recurse-limit</B> option. The <B>-R</B> option is a
|
|
synonym for the <B>--recurse-limit</B> option.
|
|
<DT id="17"><B>-s</B> <I>format</I><DD>
|
|
|
|
|
|
|
|
<DT id="18"><B>--format=</B><I>format</I><DD>
|
|
|
|
|
|
|
|
<B>c++filt</B> can decode various methods of mangling, used by
|
|
different compilers. The argument to this option selects which
|
|
method it uses:
|
|
<DL COMPACT><DT id="19"><DD>
|
|
<DL COMPACT>
|
|
<DT id="20">"auto"<DD>
|
|
|
|
|
|
|
|
|
|
Automatic selection based on executable (the default method)
|
|
<DT id="21">"gnu"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">GNU C<FONT SIZE="-2">++</FONT></FONT> compiler (g++)
|
|
<DT id="22">"lucid"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the Lucid compiler (lcc)
|
|
<DT id="23">"arm"<DD>
|
|
|
|
|
|
|
|
|
|
the one specified by the C<FONT SIZE="-2">++</FONT> Annotated Reference Manual
|
|
<DT id="24">"hp"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">HP</FONT> compiler (aCC)
|
|
<DT id="25">"edg"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">EDG</FONT> compiler
|
|
<DT id="26">"gnu-v3"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">GNU C<FONT SIZE="-2">++</FONT></FONT> compiler (g++) with the V3 <FONT SIZE="-1">ABI.</FONT>
|
|
<DT id="27">"java"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">GNU</FONT> Java compiler (gcj)
|
|
<DT id="28">"gnat"<DD>
|
|
|
|
|
|
|
|
|
|
the one used by the <FONT SIZE="-1">GNU</FONT> Ada compiler (<FONT SIZE="-1">GNAT</FONT>).
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="29"><DD>
|
|
</DL>
|
|
|
|
<DT id="30"><B>--help</B><DD>
|
|
|
|
|
|
Print a summary of the options to <B>c++filt</B> and exit.
|
|
<DT id="31"><B>--version</B><DD>
|
|
|
|
|
|
Print the version number of <B>c++filt</B> and exit.
|
|
<DT id="32"><B>@</B><I>file</I><DD>
|
|
|
|
|
|
Read command-line options from <I>file</I>. The options read are
|
|
inserted in place of the original @<I>file</I> option. If <I>file</I>
|
|
does not exist, or cannot be read, then the option will be treated
|
|
literally, and not removed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Options in <I>file</I> are separated by whitespace. A whitespace
|
|
character may be included in an option by surrounding the entire
|
|
option in either single or double quotes. Any character (including a
|
|
backslash) may be included by prefixing the character to be included
|
|
with a backslash. The <I>file</I> may itself contain additional
|
|
@<I>file</I> options; any such options will be processed recursively.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FOOTNOTES</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="33">1.<DD>
|
|
MS-DOS does not allow <TT>"+"</TT> characters in file names, so on
|
|
MS-DOS this program is named <B></B><FONT SIZE="-1"><B>CXXFILT</B></FONT><B></B>.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
the Info entries for <I>binutils</I>.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (c) 1991-2020 Free Software Foundation, Inc.
|
|
<P>
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the <FONT SIZE="-1">GNU</FONT> 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 ``<FONT SIZE="-1">GNU</FONT> Free Documentation License''.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="34"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="35"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="36"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="37"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="38"><A HREF="#lbAF">FOOTNOTES</A><DD>
|
|
<DT id="39"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="40"><A HREF="#lbAH">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:08 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|