I'm not sure when it was announced, but binutils 2.25 has been released! There's a small reason for excitement as it is the first to come with D demangling support in the GNU toolchain.

Unfortunately, I forgot to send in patches that actually document it! So for the moment, it's a little secret feature shared between all who may read this. :o)

How do you use it?

By default, binutils programs will treat all mangled symbols as C++, however you can override this by using --demangle=dlang, eg:

  objdump -d --demangle=dlang prog.o

  nm --demangle=dlang ddmd

You can also kickstart your usage by putting -L--demangle=dlang in your dmd.conf, and watch your obscure linker errors turn into pretty function signatures.

How do I get it?

The release itself is a source package, however a safer choice is to get the release binaries through your Linux distributor. Fortunately, there have been distributions who have been shipping it as early as three weeks ago.

Archlinux users: I'd imagine this is available to use now.

Ubuntu users: You'll have to wait until April with the 15.04 release.

Bugs and Fixes

Whilst the demangler is able to handle all things core.demangle can do (and a little bit more!), a small test of running nm against the ddemangle program that gets shipped with dmd 2.066 shows that there are still plenty of complex template symbols that it still can't manage. The implementation itself is pretty straightforward to follow, well documented and written in C. Volunteers who wish to help out getting as close to 99.99% coverage as possible are welcome!


Reply via email to