Debian Codegraph @

upstream/mageia-cauldron/man1/c++filt.1

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