Commit graph

18 commits

Author SHA1 Message Date
Sebastian Wilzbach
245187c7b5 Make scripts executable + runnable 2017-07-03 02:09:29 +02:00
Basile Burg
420ea97a7d flush each new demangled line 2016-09-21 19:08:05 +02:00
David Nadlinger
e32fe5dc81 Merge pull request #188 from JohanEngelen/underscore
Also match D symbols that have an extra leading underscore.
2016-06-06 18:35:48 +01:00
Johan Engelen
7df30cbbb8 Also match D symbols that have an extra leading underscore.
On some architectures, symbols have an extra underscore prepended (e.g. OS X), and e.g. C++ symbols look like: `__ZZN4llvm14MCObjectWriter10WriteZerosEjE5Zeros`.
DMD does not prepend the extra `_` for D symbols: `_D6object9Throwable8toStringMFZAya` and ddemangle works fine.
LDC does prepend the extra `_`: `__D6object9Throwable8toStringMFZAya` and ddemangle does not demangle the symbol.
c++filt has the option `--strip-underscore     Ignore first leading underscore (default)` for this issue.
I could not come up with a case where it would do harm so instead of adding such a commandline switch, this commit makes ddemangle recognize both `_D...` and `__D...` during the same execution run.
2016-05-29 22:59:40 +02:00
Johan Engelen
50eb3caa88 Fix import deprecation warning.
Warning with 2.071.0:
ddemangle.d(17): Deprecation: module std.c.stdlib is deprecated - Import core.stdc.stdlib or core.sys.posix.stdlib instead
2016-05-29 21:49:03 +02:00
H. S. Teoh
793ebde9ee Refactor code to be unittestable.
I'm ashamed of the fact that I wrote this program with zero unittests!
2013-08-27 22:24:10 -07:00
H. S. Teoh
32b42ea0d3 Use std.regex.replaceAll instead of replace().
replace() is now deprecated and required the regex to be compiled with
specific flags; the new API uses replaceAll().
2013-08-27 16:12:04 -07:00
H. S. Teoh
ecdea85285 Get rid of '-' nonsense.
It doesn't work well with getopt anyway, and apparently causes utf8
errors on Windows. Reading from stdin is achieved by omitting the
inputfile anyway.
2012-11-01 10:09:44 -07:00
H. S. Teoh
e1a73327c6 Remove debugging code. 2012-10-25 16:46:36 -07:00
H. S. Teoh
00ee69bdbf An improved version of ddemangle.
This one uses std.regex to replace all occurrences of mangled symbols
per line. Sometimes this is needed when the line just happens to contain
the wrong character sequences (_D...), which cause a real symbol later
on in the line not to be demangled, if only the first match is
attempted.

It also uses std.getopt for future extensions (ala c++filt, if we ever
decide to do that).
2012-10-25 12:39:20 -07:00
Walter Bright
f078971de3 fix build break 2012-07-24 11:07:26 -07:00
Michel Fortin
db9711c6ad Minor changes to make it more to Andrei's liking. 2011-09-04 20:46:09 -04:00
Michel Fortin
e1c6cd8be7 Fix deprecated switch statement with no default case. 2011-09-04 20:45:55 -04:00
Michel Fortin
8de843daf8 Scanning for end of symbol now done correctly in ddemangle. 2011-07-07 14:56:39 -04:00
Michel Fortin
d9ac1c62c6 Added --help switch to ddemangle. 2011-07-07 14:56:23 -04:00
Michel Fortin
1dd2f7dd01 Detab. 2011-07-05 06:49:19 -04:00
Michel Fortin
4133476996 ddemangle no longer add a line terminator on last line if there wasn't one. 2011-07-05 06:47:41 -04:00
Michel Fortin
0375eb7644 Added ddemangle. 2011-06-23 12:03:34 -04:00