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-underscore]
10 [-n|--no-strip-underscore]
11 [-p|--no-params]
12 [-t|--types]
13 [-i|--no-verbose]
14 [-r|--no-recurse-limit]
15 [-R|--recurse-limit]
16 [-s format|--format=format]
17 [--help] [--version] [symbol...]
18
20 The C++ and Java languages provide function overloading, which means
21 that you can write many functions with the same name, providing that
22 each function takes parameters of different types. In order to be able
23 to distinguish these similarly named functions C++ and Java encode them
24 into a low-level assembler name which uniquely identifies each
25 different version. This process is known as mangling. The c++filt [1]
26 program does the inverse mapping: it decodes (demangles) low-level
27 names into user-level names so that they can be read.
28
29 Every alphanumeric word (consisting of letters, digits, underscores,
30 dollars, or periods) seen in the input is a potential mangled name. If
31 the name decodes into a C++ name, the C++ name replaces the low-level
32 name in the output, otherwise the original word is output. In this way
33 you can pass an entire assembler source file, containing mangled names,
34 through c++filt and see the same source file containing demangled
35 names.
36
37 You can also use c++filt to decipher individual symbols by passing them
38 on the command line:
39
40 c++filt <symbol>
41
42 If no symbol arguments are given, c++filt reads symbol names from the
43 standard input instead. All the results are printed on the standard
44 output. The difference between reading names from the command line
45 versus reading names from the standard input is that command-line
46 arguments are expected to be just mangled names and no checking is
47 performed to separate them from surrounding text. Thus for example:
48
49 c++filt -n _Z1fv
50
51 will work and demangle the name to "f()" whereas:
52
53 c++filt -n _Z1fv,
54
55 will not work. (Note the extra comma at the end of the mangled name
56 which makes it invalid). This command however will work:
57
58 echo _Z1fv, | c++filt -n
59
60 and will display "f(),", i.e., the demangled name followed by a
61 trailing comma. This behaviour is because when the names are read from
62 the standard input it is expected that they might be part of an
63 assembler source file where there might be extra, extraneous characters
64 trailing after a mangled name. For example:
65
66 .type _Z1fv, @function
67
69 -_
70 --strip-underscore
71 On some systems, both the C and C++ compilers put an underscore in
72 front of every name. For example, the C name "foo" gets the low-
73 level name "_foo". This option removes the initial underscore.
74 Whether c++filt removes the underscore by default is target
75 dependent.
76
77 -n
78 --no-strip-underscore
79 Do not remove the initial underscore.
80
81 -p
82 --no-params
83 When demangling the name of a function, do not display the types of
84 the function's parameters.
85
86 -t
87 --types
88 Attempt to demangle types as well as function names. This is
89 disabled by default since mangled types are normally only used
90 internally in the compiler, and they can be confused with non-
91 mangled names. For example, a function called "a" treated as a
92 mangled type name would be demangled to "signed char".
93
94 -i
95 --no-verbose
96 Do not include implementation details (if any) in the demangled
97 output.
98
99 -r
100 -R
101 --recurse-limit
102 --no-recurse-limit
103 --recursion-limit
104 --no-recursion-limit
105 Enables or disables a limit on the amount of recursion performed
106 whilst demangling strings. Since the name mangling formats allow
107 for an infinite level of recursion it is possible to create strings
108 whose decoding will exhaust the amount of stack space available on
109 the host machine, triggering a memory fault. The limit tries to
110 prevent this from happening by restricting recursion to 2048 levels
111 of nesting.
112
113 The default is for this limit to be enabled, but disabling it may
114 be necessary in order to demangle truly complicated names. Note
115 however that if the recursion limit is disabled then stack
116 exhaustion is possible and any bug reports about such an event will
117 be rejected.
118
119 The -r option is a synonym for the --no-recurse-limit option. The
120 -R option is a synonym for the --recurse-limit option.
121
122 -s format
123 --format=format
124 c++filt can decode various methods of mangling, used by different
125 compilers. The argument to this option selects which method it
126 uses:
127
128 "auto"
129 Automatic selection based on executable (the default method)
130
131 "gnu"
132 the one used by the GNU C++ compiler (g++)
133
134 "lucid"
135 the one used by the Lucid compiler (lcc)
136
137 "arm"
138 the one specified by the C++ Annotated Reference Manual
139
140 "hp"
141 the one used by the HP compiler (aCC)
142
143 "edg"
144 the one used by the EDG compiler
145
146 "gnu-v3"
147 the one used by the GNU C++ compiler (g++) with the V3 ABI.
148
149 "java"
150 the one used by the GNU Java compiler (gcj)
151
152 "gnat"
153 the one used by the GNU Ada compiler (GNAT).
154
155 --help
156 Print a summary of the options to c++filt and exit.
157
158 --version
159 Print the version number of c++filt and exit.
160
161 @file
162 Read command-line options from file. The options read are inserted
163 in place of the original @file option. If file does not exist, or
164 cannot be read, then the option will be treated literally, and not
165 removed.
166
167 Options in file are separated by whitespace. A whitespace
168 character may be included in an option by surrounding the entire
169 option in either single or double quotes. Any character (including
170 a backslash) may be included by prefixing the character to be
171 included with a backslash. The file may itself contain additional
172 @file options; any such options will be processed recursively.
173
175 1. MS-DOS does not allow "+" characters in file names, so on MS-DOS
176 this program is named CXXFILT.
177
179 the Info entries for binutils.
180
182 Copyright (c) 1991-2023 Free Software Foundation, Inc.
183
184 Permission is granted to copy, distribute and/or modify this document
185 under the terms of the GNU Free Documentation License, Version 1.3 or
186 any later version published by the Free Software Foundation; with no
187 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
188 Texts. A copy of the license is included in the section entitled "GNU
189 Free Documentation License".
190
191
192
193binutils-2.41 2023-08-16 C++FILT(1)