C++FILT(1)
β¨ c++filt β the demangler bestie β¨
ok so this is a page from GNU Development Tools, and it's about c++filt, aka the program that takes those cursed low-level names and turns them back into something a human can actually read π
πΈ NAME πΈ
c++filt β demangle C++ and Java symbols. that's it. that's the job. and it slays at it π
π 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 π¦
okay so here's the whole vibe. C++ and Java have this thing called function overloading, which literally means you can write a bunch of functions with the exact same name as long as each one takes parameters of different types. iconic, honestly. but to keep them all straight, C++ and Java encode them into a low-level assembler name that uniquely identifies each different version. that process? it's called mangling π (yes, that's the real word, i'm not being dramatic for once).
c++filt [1] does the inverse mapping: it decodes (demangles) low-level names into user-level names so that they can be read. it's giving translator. it's giving main character energy π«Ά
every alphanumeric word (consisting of letters, digits, underscores, dollars, or periods) seen in the input is a potential mangled name. if the name decodes into a C++ name, the C++ name replaces the low-level name in the output β otherwise the original word is output. so you can literally pass an entire assembler source file, containing mangled names, through c++filt and see the same source file containing demangled names. no cap, whole-file glow-up β¨
you can also use c++filt to decipher individual symbols by passing them on the command line:
c++filt <symbol>
if no symbol arguments are given, c++filt reads symbol names from the standard input instead. all the results are printed on the standard output π
now here's the tea β the difference between reading names from the command line versus reading names from the standard input is that command-line arguments are expected to be just mangled names and no checking is performed 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 π bestie the comma is the villain). this command however will work:
echo _Z1fv, | c++filt -n
and will display "f(),", i.e., the demangled name followed by a trailing comma. this behaviour is because when the names are read from the standard input it is expected that they might be part of an assembler source file where there might be extra, extraneous characters trailing after a mangled name. for example:
.type _Z1fv, @function
see? the comma was never the problem. context is everything π
π OPTIONS π
-_,--strip-underscoreβ ok so on some systems, both the C and C++ compilers put an underscore in front of every name. for example, the C name "foo" gets the low-level name "_foo". this option removes the initial underscore. whetherc++filtremoves the underscore by default is target dependent π-n,--no-strip-underscoreβ do not remove the initial underscore. leave that underscore exactly where it is π«Ά-p,--no-paramsβ when demangling the name of a function, do not display the types of the function's parameters. minimalist era π-t,--typesβ attempt to demangle types as well as function names. this is disabled by default since mangled types are normally only used internally in the compiler, and they can be confused with non-mangled names. for example, a function called "a" treated as a mangled type name would be demangled to "signed char". yeah. that's the chaos this setting unlocks π-i,--no-verboseβ do not include implementation details (if any) in the demangled output. keep it cute, keep it clean β¨-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. so here's the thing: 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 π (they are NOT playing about this one).
the -r option is a synonym for the --no-recurse-limit option. the -R option is a synonym for the --recurse-limit option. lowercase r = off, uppercase R = on. iykyk π₯
-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 π«Ά--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 π (yes, it can eat its own tail. iconic.)
π FOOTNOTES π
- MS-DOS does not allow "+" characters in file names, so on MS-DOS this program is named
CXXFILT. yeah. that's the whole reason π
π SEE ALSO π
the Info entries for binutils. go read them, they're right there π«Ά
π COPYRIGHT π
Copyright (c) 1991-2026 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".
ok that's the whole page bestie, no details skipped, no options dropped, we ate and left zero crumbs π
sign-off time π this was binutils-2.46.1, dated 1980-01-01 β yes the date is older than most of us and it's still serving. bye bestie, go demangle something πβ¨
π¦ where this page comes from
- nixpkgs unstable: coreboot-toolchain-arm 26.09
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms