Debian Codegraph @

upstream/debian-unstable/man1/c++filt.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "C++FILT 1"
58 .TH C++FILT 1 2026-03-05 binutils-2.46 "GNU Development Tools"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 c++filt \- demangle C++ and Java symbols
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 c++filt [\fB\-_\fR|\fB\-\-strip\-underscore\fR]
68 [\fB\-n\fR|\fB\-\-no\-strip\-underscore\fR]
69 [\fB\-p\fR|\fB\-\-no\-params\fR]
70 [\fB\-t\fR|\fB\-\-types\fR]
71 [\fB\-i\fR|\fB\-\-no\-verbose\fR]
72 [\fB\-r\fR|\fB\-\-no\-recurse\-limit\fR]
73 [\fB\-R\fR|\fB\-\-recurse\-limit\fR]
74 [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
75 [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...]
76 .SH DESCRIPTION
77 .IX Header "DESCRIPTION"
78 The C++ and Java languages provide function overloading, which means
79 that you can write many functions with the same name, providing that
80 each function takes parameters of different types. In order to be
81 able to distinguish these similarly named functions C++ and Java
82 encode them into a low-level assembler name which uniquely identifies
83 each different version. This process is known as \fImangling\fR. The
84 \&\fBc++filt\fR
85 [1]
86 program does the inverse mapping: it decodes (\fIdemangles\fR) low-level
87 names into user-level names so that they can be read.
88 .PP
89 Every alphanumeric word (consisting of letters, digits, underscores,
90 dollars, or periods) seen in the input is a potential mangled name.
91 If the name decodes into a C++ name, the C++ name replaces the
92 low-level name in the output, otherwise the original word is output.
93 In this way you can pass an entire assembler source file, containing
94 mangled names, through \fBc++filt\fR and see the same source file
95 containing demangled names.
96 .PP
97 You can also use \fBc++filt\fR to decipher individual symbols by
98 passing them on the command line:
99 .PP
100 .Vb 1
101 \& c++filt <symbol>
102 .Ve
103 .PP
104 If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol
105 names from the standard input instead. All the results are printed on
106 the standard output. The difference between reading names from the
107 command line versus reading names from the standard input is that
108 command-line arguments are expected to be just mangled names and no
109 checking is performed to separate them from surrounding text. Thus
110 for example:
111 .PP
112 .Vb 1
113 \& c++filt \-n _Z1fv
114 .Ve
115 .PP
116 will work and demangle the name to "f()" whereas:
117 .PP
118 .Vb 1
119 \& c++filt \-n _Z1fv,
120 .Ve
121 .PP
122 will not work. (Note the extra comma at the end of the mangled
123 name which makes it invalid). This command however will work:
124 .PP
125 .Vb 1
126 \& echo _Z1fv, | c++filt \-n
127 .Ve
128 .PP
129 and will display "f(),", i.e., the demangled name followed by a
130 trailing comma. This behaviour is because when the names are read
131 from the standard input it is expected that they might be part of an
132 assembler source file where there might be extra, extraneous
133 characters trailing after a mangled name. For example:
134 .PP
135 .Vb 1
136 \& .type _Z1fv, @function
137 .Ve
138 .SH OPTIONS
139 .IX Header "OPTIONS"
140 .IP \fB\-_\fR 4
141 .IX Item "-_"
142 .PD 0
143 .IP \fB\-\-strip\-underscore\fR 4
144 .IX Item "--strip-underscore"
145 .PD
146 On some systems, both the C and C++ compilers put an underscore in front
147 of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level
148 name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether
149 \&\fBc++filt\fR removes the underscore by default is target dependent.
150 .IP \fB\-n\fR 4
151 .IX Item "-n"
152 .PD 0
153 .IP \fB\-\-no\-strip\-underscore\fR 4
154 .IX Item "--no-strip-underscore"
155 .PD
156 Do not remove the initial underscore.
157 .IP \fB\-p\fR 4
158 .IX Item "-p"
159 .PD 0
160 .IP \fB\-\-no\-params\fR 4
161 .IX Item "--no-params"
162 .PD
163 When demangling the name of a function, do not display the types of
164 the function's parameters.
165 .IP \fB\-t\fR 4
166 .IX Item "-t"
167 .PD 0
168 .IP \fB\-\-types\fR 4
169 .IX Item "--types"
170 .PD
171 Attempt to demangle types as well as function names. This is disabled
172 by default since mangled types are normally only used internally in
173 the compiler, and they can be confused with non-mangled names. For example,
174 a function called "a" treated as a mangled type name would be
175 demangled to "signed char".
176 .IP \fB\-i\fR 4
177 .IX Item "-i"
178 .PD 0
179 .IP \fB\-\-no\-verbose\fR 4
180 .IX Item "--no-verbose"
181 .PD
182 Do not include implementation details (if any) in the demangled
183 output.
184 .IP \fB\-r\fR 4
185 .IX Item "-r"
186 .PD 0
187 .IP \fB\-R\fR 4
188 .IX Item "-R"
189 .IP \fB\-\-recurse\-limit\fR 4
190 .IX Item "--recurse-limit"
191 .IP \fB\-\-no\-recurse\-limit\fR 4
192 .IX Item "--no-recurse-limit"
193 .IP \fB\-\-recursion\-limit\fR 4
194 .IX Item "--recursion-limit"
195 .IP \fB\-\-no\-recursion\-limit\fR 4
196 .IX Item "--no-recursion-limit"
197 .PD
198 Enables or disables a limit on the amount of recursion performed
199 whilst demangling strings. Since the name mangling formats allow for
200 an infinite level of recursion it is possible to create strings whose
201 decoding will exhaust the amount of stack space available on the host
202 machine, triggering a memory fault. The limit tries to prevent this
203 from happening by restricting recursion to 2048 levels of nesting.
204 .Sp
205 The default is for this limit to be enabled, but disabling it may be
206 necessary in order to demangle truly complicated names. Note however
207 that if the recursion limit is disabled then stack exhaustion is
208 possible and any bug reports about such an event will be rejected.
209 .Sp
210 The \fB\-r\fR option is a synonym for the
211 \&\fB\-\-no\-recurse\-limit\fR option. The \fB\-R\fR option is a
212 synonym for the \fB\-\-recurse\-limit\fR option.
213 .IP "\fB\-s\fR \fIformat\fR" 4
214 .IX Item "-s format"
215 .PD 0
216 .IP \fB\-\-format=\fR\fIformat\fR 4
217 .IX Item "--format=format"
218 .PD
219 \&\fBc++filt\fR can decode various methods of mangling, used by
220 different compilers. The argument to this option selects which
221 method it uses:
222 .RS 4
223 .ie n .IP """auto""" 4
224 .el .IP \f(CWauto\fR 4
225 .IX Item "auto"
226 Automatic selection based on executable (the default method)
227 .ie n .IP """gnu""" 4
228 .el .IP \f(CWgnu\fR 4
229 .IX Item "gnu"
230 the one used by the GNU C++ compiler (g++)
231 .ie n .IP """lucid""" 4
232 .el .IP \f(CWlucid\fR 4
233 .IX Item "lucid"
234 the one used by the Lucid compiler (lcc)
235 .ie n .IP """arm""" 4
236 .el .IP \f(CWarm\fR 4
237 .IX Item "arm"
238 the one specified by the C++ Annotated Reference Manual
239 .ie n .IP """hp""" 4
240 .el .IP \f(CWhp\fR 4
241 .IX Item "hp"
242 the one used by the HP compiler (aCC)
243 .ie n .IP """edg""" 4
244 .el .IP \f(CWedg\fR 4
245 .IX Item "edg"
246 the one used by the EDG compiler
247 .ie n .IP """gnu\-v3""" 4
248 .el .IP \f(CWgnu\-v3\fR 4
249 .IX Item "gnu-v3"
250 the one used by the GNU C++ compiler (g++) with the V3 ABI.
251 .ie n .IP """java""" 4
252 .el .IP \f(CWjava\fR 4
253 .IX Item "java"
254 the one used by the GNU Java compiler (gcj)
255 .ie n .IP """gnat""" 4
256 .el .IP \f(CWgnat\fR 4
257 .IX Item "gnat"
258 the one used by the GNU Ada compiler (GNAT).
259 .RE
260 .RS 4
261 .RE
262 .IP \fB\-\-help\fR 4
263 .IX Item "--help"
264 Print a summary of the options to \fBc++filt\fR and exit.
265 .IP \fB\-\-version\fR 4
266 .IX Item "--version"
267 Print the version number of \fBc++filt\fR and exit.
268 .IP \fB@\fR\fIfile\fR 4
269 .IX Item "@file"
270 Read command-line options from \fIfile\fR. The options read are
271 inserted in place of the original @\fIfile\fR option. If \fIfile\fR
272 does not exist, or cannot be read, then the option will be treated
273 literally, and not removed.
274 .Sp
275 Options in \fIfile\fR are separated by whitespace. A whitespace
276 character may be included in an option by surrounding the entire
277 option in either single or double quotes. Any character (including a
278 backslash) may be included by prefixing the character to be included
279 with a backslash. The \fIfile\fR may itself contain additional
280 @\fIfile\fR options; any such options will be processed recursively.
281 .SH FOOTNOTES
282 .IX Header "FOOTNOTES"
283 .IP 1. 4
284 MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on
285 MS-DOS this program is named \fBCXXFILT\fR.
286 .SH "SEE ALSO"
287 .IX Header "SEE ALSO"
288 the Info entries for \fIbinutils\fR.
289 .SH COPYRIGHT
290 .IX Header "COPYRIGHT"
291 Copyright (c) 1991\-2026 Free Software Foundation, Inc.
292 .PP
293 Permission is granted to copy, distribute and/or modify this document
294 under the terms of the GNU Free Documentation License, Version 1.3
295 or any later version published by the Free Software Foundation;
296 with no Invariant Sections, with no Front-Cover Texts, and with no
297 Back-Cover Texts. A copy of the license is included in the
298 section entitled "GNU Free Documentation License".