CPP: c++filt

man /usr/bin/c++filt

C++FILT(1) GNU Development Tools C++FILT(1)

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]
[-s format|--format=format]
[--help] [--version] [symbol...]

DESCRIPTION
The C++ and Java languages provide function overloading, which means that you can write many functions with the same name,
providing that each function takes parameters of different types. In order to be able to distinguish these similarly named
functions C++ and Java encode them into a low-level assembler name which uniquely identifies each different version. This process
is known as mangling. The c++filt [1] program does the inverse mapping: it decodes (demangles) low-level names into user-level
names so that they can be read.

   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.  In this way you can pass an entire assembler source file, containing mangled names, through c++filt and see the same
   source file containing demangled names.

   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.  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.
   Thus 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(),", 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

OPTIONS
-_
--strip-underscore
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. Whether c++filt removes the underscore by default is
target dependent.

   -n
   --no-strip-underscore
       Do not remove the initial underscore.

   -p
   --no-params
       When demangling the name of a function, do not display the types of the function's parameters.

   -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".

   -i
   --no-verbose
       Do not include implementation details (if any) in the demangled output.

   -s format
   --format=format
       c++filt can 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 to c++filt and exit.

   --version
       Print the version number of c++filt and exit.

   @file
       Read command-line options from file.  The options read are inserted in place of the original @file option.  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.

FOOTNOTES
1. MS-DOS does not allow "+" characters in file names, so on MS-DOS this program is named CXXFILT.

SEE ALSO
the Info entries for binutils.


參考:
http://blog.csdn.net/stpeace/article/details/51416297

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末蜂绎,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 210,914評(píng)論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件临燃,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)俱病,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 89,935評(píng)論 2 383
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來袱结,“玉大人亮隙,你說我怎么就攤上這事∏婵保” “怎么了咱揍?”我有些...
    開封第一講書人閱讀 156,531評(píng)論 0 345
  • 文/不壞的土叔 我叫張陵,是天一觀的道長棚饵。 經(jīng)常有香客問我煤裙,道長,這世上最難降的妖魔是什么噪漾? 我笑而不...
    開封第一講書人閱讀 56,309評(píng)論 1 282
  • 正文 為了忘掉前任硼砰,我火速辦了婚禮,結(jié)果婚禮上欣硼,老公的妹妹穿的比我還像新娘题翰。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,381評(píng)論 5 384
  • 文/花漫 我一把揭開白布豹障。 她就那樣靜靜地躺著冯事,像睡著了一般。 火紅的嫁衣襯著肌膚如雪血公。 梳的紋絲不亂的頭發(fā)上昵仅,一...
    開封第一講書人閱讀 49,730評(píng)論 1 289
  • 那天,我揣著相機(jī)與錄音累魔,去河邊找鬼摔笤。 笑死,一個(gè)胖子當(dāng)著我的面吹牛垦写,可吹牛的內(nèi)容都是我干的吕世。 我是一名探鬼主播,決...
    沈念sama閱讀 38,882評(píng)論 3 404
  • 文/蒼蘭香墨 我猛地睜開眼梯投,長吁一口氣:“原來是場噩夢啊……” “哼命辖!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起晚伙,我...
    開封第一講書人閱讀 37,643評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤吮龄,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后咆疗,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體漓帚,經(jīng)...
    沈念sama閱讀 44,095評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,448評(píng)論 2 325
  • 正文 我和宋清朗相戀三年午磁,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了尝抖。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,566評(píng)論 1 339
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡迅皇,死狀恐怖昧辽,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情登颓,我是刑警寧澤搅荞,帶...
    沈念sama閱讀 34,253評(píng)論 4 328
  • 正文 年R本政府宣布,位于F島的核電站框咙,受9級(jí)特大地震影響咕痛,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜喇嘱,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,829評(píng)論 3 312
  • 文/蒙蒙 一茉贡、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧者铜,春花似錦腔丧、人聲如沸放椰。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,715評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽砾医。三九已至,卻和暖如春科汗,著一層夾襖步出監(jiān)牢的瞬間藻烤,已是汗流浹背绷雏。 一陣腳步聲響...
    開封第一講書人閱讀 31,945評(píng)論 1 264
  • 我被黑心中介騙來泰國打工头滔, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人涎显。 一個(gè)月前我還...
    沈念sama閱讀 46,248評(píng)論 2 360
  • 正文 我出身青樓坤检,卻偏偏與公主長得像,于是被迫代替她去往敵國和親期吓。 傳聞我的和親對(duì)象是個(gè)殘疾皇子早歇,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,440評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容