1C++FILT(1) GNU Development Tools C++FILT(1)
2
3
4
6 c++filt - Demangle C++ and Java symbols.
7
9 c++filt [-_⎪--strip-underscores]
10 [-n⎪--no-strip-underscores]
11 [-p⎪--no-params]
12 [-t⎪--types]
13 [-i⎪--no-verbose]
14 [-s format⎪--format=format]
15 [--help] [--version] [symbol...]
16
18 The C++ and Java languages provide function overloading, which means
19 that you can write many functions with the same name, providing that
20 each function takes parameters of different types. In order to be able
21 to distinguish these similarly named functions C++ and Java encode them
22 into a low-level assembler name which uniquely identifies each differ‐
23 ent version. This process is known as mangling. The c++filt [1] pro‐
24 gram does the inverse mapping: it decodes (demangles) low-level names
25 into user-level names so that they can be read.
26
27 Every alphanumeric word (consisting of letters, digits, underscores,
28 dollars, or periods) seen in the input is a potential mangled name. If
29 the name decodes into a C++ name, the C++ name replaces the low-level
30 name in the output, otherwise the original word is output. In this way
31 you can pass an entire assembler source file, containing mangled names,
32 through c++filt and see the same source file containing demangled
33 names.
34
35 You can also use c++filt to decipher individual symbols by passing them
36 on the command line:
37
38 c++filt <symbol>
39
40 If no symbol arguments are given, c++filt reads symbol names from the
41 standard input instead. All the results are printed on the standard
42 output. The difference between reading names from the command line
43 versus reading names from the standard input is that command line argu‐
44 ments are expected to be just mangled names and no checking is per‐
45 formed to separate them from surrounding text. Thus for example:
46
47 c++filt -n _Z1fv
48
49 will work and demangle the name to "f()" whereas:
50
51 c++filt -n _Z1fv,
52
53 will not work. (Note the extra comma at the end of the mangled name
54 which makes it invalid). This command however will work:
55
56 echo _Z1fv, ⎪ c++filt -n
57
58 and will display "f(),", i.e., the demangled name followed by a trail‐
59 ing comma. This behaviour is because when the names are read from the
60 standard input it is expected that they might be part of an assembler
61 source file where there might be extra, extraneous characters trailing
62 after a mangled name. For example:
63
64 .type _Z1fv, @function
65
67 -_
68 --strip-underscores
69 On some systems, both the C and C++ compilers put an underscore in
70 front of every name. For example, the C name "foo" gets the low-
71 level name "_foo". This option removes the initial underscore.
72 Whether c++filt removes the underscore by default is target depen‐
73 dent.
74
75 -j
76 --java
77 Prints demangled names using Java syntax. The default is to use
78 C++ syntax.
79
80 -n
81 --no-strip-underscores
82 Do not remove the initial underscore.
83
84 -p
85 --no-params
86 When demangling the name of a function, do not display the types of
87 the function's parameters.
88
89 -t
90 --types
91 Attempt to demangle types as well as function names. This is dis‐
92 abled by default since mangled types are normally only used inter‐
93 nally in the compiler, and they can be confused with non-mangled
94 names. For example, a function called "a" treated as a mangled
95 type name would be demangled to "signed char".
96
97 -i
98 --no-verbose
99 Do not include implementation details (if any) in the demangled
100 output.
101
102 -s format
103 --format=format
104 c++filt can decode various methods of mangling, used by different
105 compilers. The argument to this option selects which method it
106 uses:
107
108 "auto"
109 Automatic selection based on executable (the default method)
110
111 "gnu"
112 the one used by the GNU C++ compiler (g++)
113
114 "lucid"
115 the one used by the Lucid compiler (lcc)
116
117 "arm"
118 the one specified by the C++ Annotated Reference Manual
119
120 "hp"
121 the one used by the HP compiler (aCC)
122
123 "edg"
124 the one used by the EDG compiler
125
126 "gnu-v3"
127 the one used by the GNU C++ compiler (g++) with the V3 ABI.
128
129 "java"
130 the one used by the GNU Java compiler (gcj)
131
132 "gnat"
133 the one used by the GNU Ada compiler (GNAT).
134
135 --help
136 Print a summary of the options to c++filt and exit.
137
138 --version
139 Print the version number of c++filt and exit.
140
141 @file
142 Read command-line options from file. The options read are inserted
143 in place of the original @file option. If file does not exist, or
144 cannot be read, then the option will be treated literally, and not
145 removed.
146
147 Options in file are separated by whitespace. A whitespace charac‐
148 ter may be included in an option by surrounding the entire option
149 in either single or double quotes. Any character (including a
150 backslash) may be included by prefixing the character to be
151 included with a backslash. The file may itself contain additional
152 @file options; any such options will be processed recursively.
153
155 1. MS-DOS does not allow "+" characters in file names, so on MS-DOS
156 this program is named CXXFILT.
157
159 the Info entries for binutils.
160
162 Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
163 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
164 Foundation, Inc.
165
166 Permission is granted to copy, distribute and/or modify this document
167 under the terms of the GNU Free Documentation License, Version 1.2 or
168 any later version published by the Free Software Foundation; with no
169 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
170 Texts. A copy of the license is included in the section entitled "GNU
171 Free Documentation License".
172
173
174
175binutils-2.18.90 2008-09-10 C++FILT(1)