Skip to content

Commit

Permalink
reflow README lines
Browse files Browse the repository at this point in the history
never use github's web interface for editing READMEs, it messes up :-(
  • Loading branch information
nico committed Dec 6, 2016
1 parent c232a3b commit 932b456
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ POSIX and Windows.
$ ./demumble "?Fx_i@@YAHP6AHH@Z@Z"
int __cdecl Fx_i(int (__cdecl*)(int))

It has several nice features that c++filt lacks (and lacks many of c++filt's features I never use).
It has several nice features that c++filt lacks (and lacks many of c++filt's
features I never use).

Smart about underscores: C++ symbols have an additional leading underscore on OS X. `operator new` is mangled as `_Znw` on Linux but `__Znw` on Mac. OS X's c++filt automatically strips one leading underscore, but Linux's c++filt doesn't. So if you want to demangle a Linux symbol on OS X, you need to pass `-n` to tell it to not strip the underscore, and if you want to demangle an OS X symbol on Linux you likewise need to pass `-_`. demumble just does the right thing:
Smart about underscores: C++ symbols have an additional leading underscore on
OS X. `operator new` is mangled as `_Znw` on Linux but `__Znw` on Mac. OS X's
c++filt automatically strips one leading underscore, but Linux's c++filt
doesn't. So if you want to demangle a Linux symbol on OS X, you need to pass
`-n` to tell it to not strip the underscore, and if you want to demangle an OS
X symbol on Linux you likewise need to pass `-_`. demumble just does the right
thing:

$ c++filt _Znw
_Znw
Expand All @@ -21,7 +28,10 @@ Smart about underscores: C++ symbols have an additional leading underscore on OS
$ demumble __Znw
operator new

Smart about filtering: Both c++filt and demumble can work as a stdin filter. demumble only demangles function symbols (which never look like other words), while c++filt defaults to demangling type names too, which are likely to look like regular words. demumble does demangle types when they're passed as args:
Smart about filtering: Both c++filt and demumble can work as a stdin filter.
demumble only demangles function symbols (which never look like other words),
while c++filt defaults to demangling type names too, which are likely to look
like regular words. demumble does demangle types when they're passed as args:

$ echo 'I like Pi and _Znw' | c++filt
I like int* and _Znw
Expand All @@ -32,14 +42,16 @@ Smart about filtering: Both c++filt and demumble can work as a stdin filter. dem
$ demumble Pi
int*

Cross-platform: demumble runs on Windows. demumble can demangle Windows-style symbols (also when running on non-Windows).
Cross-platform: demumble runs on Windows. demumble can demangle Windows-style
symbols (also when running on non-Windows).

$ demumble '??2@YAPEAX_K@Z'
void * __ptr64 __cdecl operator new(unsigned __int64)
$ c++filt '??2@YAPEAX_K@Z'
??2@YAPEAX_K@Z

demumble also has a flag to make it print only things that look like symbols. For example, to print demangled names of all functions defined in a bitcode file:
demumble also has a flag to make it print only things that look like symbols.
For example, print demangled names of all functions defined in a bitcode file:

$ grep '^define' bitcode-win.ll | demumble -m | head -1
unsigned int __cdecl v8::RoundUpToPowerOfTwo32(unsigned int)
Expand Down

0 comments on commit 932b456

Please sign in to comment.