C++FILT(1)
π c++filt β the demangling bestie π
okay so. welcome to the GNU Development Tools corner of the manual-verse, bestie, where we're talking about c++filt π β the lil glow-up machine that takes your cursed low-level symbol soup and turns it back into something a human can actually read. no cap, this one's iconic.
β¨ NAME β¨
c++filt β demangle C++ and Java symbols π
πΈ SYNOPSIS πΈ
c++filt [-_|--strip-underscore]
[-n|--no-strip-underscore]
[-p|--no-params]
[-t|--types]
[-i|--no-verbose]
[-r|--no-recurse-limit]
[-R|--recurse-limit]
[-s format|--format=format]
[--help] [--version] [symbol...]
π¦ DESCRIPTION π¦
so here's the tea, bestie. C++ and Java both do this thing called function overloading, which basically means you can write a whole bunch of functions with the same name, as long as each one takes parameters of different types. and likeβ¦ cute for humans, but the linker needs to tell them apart!! so C++ and Java encode each one into a low-level assembler name that uniquely identifies every single version. that process? it's called mangling. π
and c++filt [1] does the inverse mapping β it decodes (demangles) those low-level names back into user-level names so you can actually read them. it's giving translator. it's giving reverse-uno. π₯
every alphanumeric word you see in the input β and by that I mean letters, digits, underscores, dollars, or periods β is a potential mangled name. if the name decodes into a C++ name, then boom, the C++ name replaces the low-level name in the output. if it doesn't decode, the original word justβ¦ comes out as-is. so you can legit pass an entire assembler source file full of mangled names through c++filt and get the same source file back, but demangled. main character energy tbh. β¨
you can also just vibe-check individual symbols by passing them on the command line:
c++filt <symbol>
if you give it no symbol arguments at all, c++filt reads symbol names from the standard input instead. all results go to standard output. π«Ά
now here's the difference you NEED to know: command-line arguments are expected to be just mangled names, and no checking happens to separate them from surrounding text. so for example:
c++filt -n _Z1fv
will work and demangle the name to "f()", whereas:
c++filt -n _Z1fv,
will NOT work. (note the extra comma at the end of the mangled name which makes it invalid π). this command however will work:
echo _Z1fv, | c++filt -n
and will display "f()," β that's the demangled name followed by a trailing comma. why? because when names are read from standard input, it's expected that they might be part of an assembler source file where there could be extra, extraneous characters trailing after a mangled name. for example:
.type _Z1fv, @function
slay. π
π OPTIONS π
-_,--strip-underscoreβ on some systems, both the C and C++ compilers slap an underscore in front of every name. like, the C name"foo"gets the low-level name"_foo". this option removes that initial underscore. whetherc++filtremoves the underscore by default is target dependent, so likeβ¦ don't assume, bestie. π-n,--no-strip-underscoreβ do NOT remove the initial underscore. that's it. that's the whole vibe. β¨-p,--no-paramsβ when demangling the name of a function, don't display the types of the function's parameters. sometimes you just want the name, yk?-t,--typesβ try to demangle types as well as function names. this is disabled by default because mangled types are normally only used internally in the compiler, and they can get confused with non-mangled names. for example, a function called"a"treated as a mangled type name would be demangled to"signed char". π iconic chaos, honestly.-i,--no-verboseβ don't include implementation details (if any) in the demangled output.-r,-R,--recurse-limit,--no-recurse-limit,--recursion-limit,--no-recursion-limitβ enables or disables a limit on the amount of recursion performed whilst demangling strings. since the name mangling formats allow for an infinite 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.
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. π¨
the -r option is a synonym for the --no-recurse-limit option. the -R option is a synonym for the --recurse-limit option.
-s format,--format=formatβc++filtcan decode various methods of mangling, used by different compilers. the argument to this option selects which method it uses:"auto"β automatic selection based on executable (the default method)"gnu"β the one used by the GNU C++ compiler (g++)"lucid"β the one used by the Lucid compiler (lcc)"arm"β the one specified by the C++ Annotated Reference Manual"hp"β the one used by the HP compiler (aCC)"edg"β the one used by the EDG compiler"gnu-v3"β the one used by the GNU C++ compiler (g++) with the V3 ABI."java"β the one used by the GNU Java compiler (gcj)"gnat"β the one used by the GNU Ada compiler (GNAT).
--helpβ print a summary of the options toc++filtand exit. the classic. π«Ά--versionβ print the version number ofc++filtand exit.@fileβ read command-line options from file. the options read are inserted in place of the original@fileoption. if file does not exist, or cannot be read, then the option will be treated literally, and not removed.
options in file 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 file may itself contain additional @file options; any such options will be processed recursively. π recursion-ception, but for config files.
π§ FOOTNOTES π§
- MS-DOS does not allow
"+"characters in file names, so on MS-DOS this program is namedCXXFILT. π
π SEE ALSO π
- the Info entries for
binutils.
π COPYRIGHT π
Copyright (c) 1991-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU 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 "GNU Free Documentation License".
and that's a wrap, bestie π this whole page is binutils-2.45.50, dated 2026-01-13, and it's the C++FILT(1) manual page β go forth and demangle, you absolute icon ππ
π¦ where this page comes from
- ubuntu resolute: binutils-m68hc1x 1:2.45.50.20251209+3.5.3build1 Β· GPL-3.0-or-later
- ubuntu stonking: binutils-m68hc1x 1:2.45.50.20251209+3.5.3build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms