mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
* biutils.texi: revised c++filt chapter
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
Thu May 27 16:58:31 1993 Jeffrey Osier (jeffrey@cygnus.com)
|
||||||
|
|
||||||
|
* biutils.texi: revised c++filt chapter
|
||||||
|
|
||||||
Wed May 26 17:24:17 1993 Ian Lance Taylor (ian@cygnus.com)
|
Wed May 26 17:24:17 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||||
|
|
||||||
* Makefile.in (FLAGS_TO_PASS): Pass down CC and CFLAGS.
|
* Makefile.in (FLAGS_TO_PASS): Pass down CC and CFLAGS.
|
||||||
|
@ -1102,22 +1102,33 @@ archives, @samp{strip -v} lists all members of the archive.
|
|||||||
@kindex c++filt
|
@kindex c++filt
|
||||||
@cindex demangling C++ symbols
|
@cindex demangling C++ symbols
|
||||||
|
|
||||||
The C++ language provides function overloading, which means that
|
The C++ language provides function overloading, which means that you can
|
||||||
you can write many function with the same name (but taking
|
write many functions with the same name (providing each takes parameters
|
||||||
different kinds of parameters). So that the linker can keep these
|
of different types). All C++ function names are encoded into a
|
||||||
overloaded functions from clashing, all C++ function names are
|
low-level assembly label (in some circles this is described as
|
||||||
encoded (``mangled'') into a funny-looking low-level assembly label.
|
@dfn{mangling}). The @code{c++filt} program does the inverse mapping: it
|
||||||
The @code{c++filt} program does the inverse mapping: It decodes
|
decodes (@dfn{demangles}) low-level names into user-level names so that
|
||||||
(``demangles'') low-level names into user-level names.
|
the linker can keep these overloaded functions from clashing.
|
||||||
|
|
||||||
When you use @code{c++filt} as a filter (which is usually the case),
|
Every alphanumeric word (consisting of letters, digits, underscores,
|
||||||
it reads from standard input. Every alphanumeric word (consisting
|
dollars, or periods) seen in the input is a potential label. If the
|
||||||
of letters, digits, underscores, dollars, or periods) seen in the
|
label decodes into a C++ name, the C++ name replaces the low-level
|
||||||
input is a potential label. If the label decodes into a C++ name.
|
name in the output.
|
||||||
the C++ name will replace the low-level name in the output.
|
|
||||||
|
|
||||||
A typical use of @code{c++filt} is to pipe the output of @code{nm}
|
A typical use of @code{c++filt} is to pipe the output of @code{nm}
|
||||||
though it.
|
though it, using @code{c++filt} as a filter:
|
||||||
|
|
||||||
|
@example
|
||||||
|
nm @var{objfile} | c++filt
|
||||||
|
@end example
|
||||||
|
|
||||||
|
You can also use @code{c++filt} to decipher individual symbols:
|
||||||
|
|
||||||
|
@example
|
||||||
|
c++filt @var{symbol}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
All results are printed on the standard output.
|
||||||
|
|
||||||
Note that on some systems, both the C and C++ compilers put an
|
Note that on some systems, both the C and C++ compilers put an
|
||||||
underscore in front of every name. (I.e. the C name @code{foo} gets the
|
underscore in front of every name. (I.e. the C name @code{foo} gets the
|
||||||
|
Reference in New Issue
Block a user