C++FILT(1)
β¨ NAME β¨
okay bestie, gather round β this one's c++filt, and it's here to demangle C++ and Java symbols. that's the whole vibe. π
π¦ SYNOPSIS π¦
c++filt [-_|--strip-underscores]
[-j|--java]
[-n|--no-strip-underscores]
[-p|--no-params]
[-s format|--format=format]
[--help] [--version] [symbol...]
π DESCRIPTION π
so here's the tea, bestie β β C++ and Java both do function overloading, which is a fancy way of saying you can write a million functions with the same name as long as each one takes parameters of different types. cute, right? but there's a catch.
every C++ and Java function name gets encoded into a low-level assembly label. that process? it's called mangling. π iconic but unreadable.
and c++filt does the inverse mapping: it decodes (aka demangles) those low-level names back into user-level names, so the linker can keep all your overloaded functions from clashing into each other. it's giving main character energy honestly. β¨
every alphanumeric word you see in the input β and by alphanumeric we mean letters, digits, underscores, dollars, or periods β is a potential label. if that label decodes into a C++ name, the C++ name replaces the low-level name in the output. slay. π
you can use c++filt to decipher individual symbols like this:
c++filt <symbol>
and if you don't give it any symbol arguments at all? no problem, bestie. c++filt just reads symbol names from the standard input and writes the demangled names to the standard output. all results get printed on the standard output. periodt. πΈ
π OPTIONS π
-_,--strip-underscoresβ okay so on some systems, both the C and the C++ compilers slap an underscore in front of every single name. like, the C name"foo"becomes the low-level name"_foo". rude. this option removes that initial underscore. and whetherc++filtremoves the underscore by default? that's target dependent, so don't @ me. π-j,--javaβ prints demangled names using Java syntax. the default is to use C++ syntax. pick your fighter. π-n,--no-strip-underscoresβ do not remove the initial underscore. that's it, that's the option.-p,--no-paramsβ when demangling the name of a function, don't display the types of the function's parameters. minimalist queen. π-s format,--format=formatβc++filtcan decode various methods of mangling, used by different compilers, and the argument to this option picks which method it uses:"auto"β automatic selection based on executable (this is 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β prints a summary of the options toc++filtand exits. bye bestie π«Ά--versionβ prints the version number ofc++filtand exits. β¨
π FOOTNOTES π
- MS-DOS does not allow
"+"characters in file names, so on MS-DOS this program is namedCXXFILT. no plus signs allowed, we don't make the rules. π
π SEE ALSO π
- the Info entries for
binutils.
π COPYRIGHT π
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.1 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 the whole page, bestie π₯Ή this was binutils-2.15.97, dated 2005-04-20, and yeah β the manual it lives in is literally called C++FILT(1). mwah. ππ β¨
π¦ where this page comes from
- debian bookworm: binutils-h8300-hms 2.16.1-10+b2
- debian trixie: binutils-h8300-hms 2.16.1-13
- ubuntu jammy: binutils-h8300-hms 2.16.1-10build1
- ubuntu noble: binutils-h8300-hms 2.16.1-10build1
- ubuntu resolute: binutils-h8300-hms 2.16.1-15
- ubuntu stonking: binutils-h8300-hms 2.16.1-15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms