www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Binutils 2.25 Released - New D demangling support

reply "Iain Buclaw" <ibuclaw gdcproject.org> writes:
Hi,

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!


Enjoy!
Iain.
Jan 13 2015
next sibling parent reply "Kiith-Sa" <kiithsacmp gmail.com> writes:
On Tuesday, 13 January 2015 at 21:31:15 UTC, Iain Buclaw wrote:
 Hi,

 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.
Could you add this note somewhere visible into the wiki so it doesn't get lost? Also, could DMD do this by default if available so it works out of the box?
Jan 13 2015
parent Iain Buclaw via Digitalmars-d-announce writes:
On 13 January 2015 at 21:39, Kiith-Sa via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Tuesday, 13 January 2015 at 21:31:15 UTC, Iain Buclaw wrote:
 Hi,

 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.
Could you add this note somewhere visible into the wiki so it doesn't get lost? Also, could DMD do this by default if available so it works out of the box?
This can be done, but I'd rather it be added later instead of now when it is more likely that the reader is running a system that has binutils 2.25+ installed. For having this as default dmd.conf setting in future DMD releases, there will have to be an even longer waiting period of at least a year and a bit before it gets added. This will allow users to upgrade to their systems to a version of binutils which supports this feature, otherwise you are risking (in their eyes) breaking DMD with no obvious good reason. The auto-tester build systems will need to be upgraded also... Iain.
Jan 13 2015
prev sibling next sibling parent reply "deadalnix" <deadalnix gmail.com> writes:
This deserve to be on reddit.
Jan 13 2015
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 1/13/15 1:51 PM, deadalnix wrote:
 This deserve to be on reddit.
Ask, and ye shall receive. http://www.reddit.com/r/programming/comments/2sbxto/gnu_binutils_225_released_with_d_demangling/ Andrie
Jan 13 2015
prev sibling next sibling parent ketmar via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
On Tue, 13 Jan 2015 21:31:14 +0000
Iain Buclaw via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:

 Hi,
=20
 I'm not sure when it was announced, but binutils 2.25 has been=20
 released!  There's a small reason for excitement as it is the=20
 first to come with D demangling support in the GNU toolchain.
=20
 Unfortunately, I forgot to send in patches that actually document=20
 it!  So for the moment, it's a little secret feature shared=20
 between all who may read this.  :o)
wow! this is great news! i'm off to rebuild my binutils package. ;-)
Jan 13 2015
prev sibling next sibling parent reply Paul O'Neil <redballoon36 gmail.com> writes:
This looks great!

Does this mean anything with respect to getting better demangling in GDB?

-- 
Paul O'Neil
Github / IRC: todayman
Jan 13 2015
next sibling parent reply ketmar via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
On Tue, 13 Jan 2015 17:07:02 -0500
"Paul O'Neil via Digitalmars-d-announce"
<digitalmars-d-announce puremagic.com> wrote:

 This looks great!
=20
 Does this mean anything with respect to getting better demangling in GDB?
it seems to be so. at least i see in git some words about "using gdb demangler" and such.
Jan 13 2015
parent Paul O'Neil <redballoon36 gmail.com> writes:
On 01/13/2015 05:22 PM, ketmar via Digitalmars-d-announce wrote:
 On Tue, 13 Jan 2015 17:07:02 -0500
 "Paul O'Neil via Digitalmars-d-announce"
 <digitalmars-d-announce puremagic.com> wrote:
 
 This looks great!

 Does this mean anything with respect to getting better demangling in GDB?
it seems to be so. at least i see in git some words about "using gdb demangler" and such.
Paying attention to the stack trace right in front of me shows properly demangled D names! Even more awesome! -- Paul O'Neil Github / IRC: todayman
Jan 13 2015
prev sibling parent Iain Buclaw via Digitalmars-d-announce writes:
On 13 January 2015 at 22:07, Paul O'Neil via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 This looks great!

 Does this mean anything with respect to getting better demangling in GDB?
This was first written for GDB (announced at DConf 2014) but without the template demangling. Then later migrated over to a libiberty - with template demangling (announced October 2014) that made it common code between both GDB and Binutils. Iain.
Jan 13 2015
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-01-13 22:31, Iain Buclaw wrote:
 Hi,

 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.
Is this something what will work on OS X? I'm not sure how much of the GNU toolchain is still being used. -- /Jacob Carlborg
Jan 13 2015
parent reply Iain Buclaw via Digitalmars-d-announce writes:
On 14 January 2015 at 07:30, Jacob Carlborg via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On 2015-01-13 22:31, Iain Buclaw wrote:
 Hi,

 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.
Is this something what will work on OS X? I'm not sure how much of the GNU toolchain is still being used.
I can't comment on that. Maybe via Macports? Otherwise if BSD have their own linker, someone will need to go and get friendly with the developers up their toolchain.
Jan 14 2015
parent reply Jacob Carlborg <doob me.com> writes:
On 2015-01-14 09:46, Iain Buclaw via Digitalmars-d-announce wrote:

 I can't comment on that.  Maybe via Macports?  Otherwise if BSD have
 their own linker, someone will need to go and get friendly with the
 developers up their toolchain.
Right, forgot about that the toolchain is BSD based. -- /Jacob Carlborg
Jan 14 2015
parent "Joakim" <dlang joakim.fea.st> writes:
On Wednesday, 14 January 2015 at 14:42:09 UTC, Jacob Carlborg 
wrote:
 On 2015-01-14 09:46, Iain Buclaw via Digitalmars-d-announce 
 wrote:

 I can't comment on that.  Maybe via Macports?  Otherwise if 
 BSD have
 their own linker, someone will need to go and get friendly 
 with the
 developers up their toolchain.
Right, forgot about that the toolchain is BSD based.
I was curious what they're actually using these days, so I looked it up. Appears to be some APS-licensed Mach-O linker they wrote themselves in C++: http://opensource.apple.com/tarballs/ld64/
Jan 14 2015
prev sibling next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
Awesome work, thanks! Already available on Arch Linux indeed, 
just typed objdump as per your post and it worked. Editing my 
dmd.conf right now.

Atila

On Tuesday, 13 January 2015 at 21:31:15 UTC, Iain Buclaw wrote:
 Hi,

 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!


 Enjoy!
 Iain.
Jan 14 2015
prev sibling parent reply "Laeeth Isharc" <laeethnospam nospamlaeeth.com> writes:
 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.
In case it saves someone else a few minutes: for Fedora 21 (and probably others). (At your own risk if new version of binutils breaks something else). yum install fedora-repos-rawhide yum install binutils --enablerepo rawhide objdump -v
Jan 20 2015
parent "Laeeth Isharc" <laeethnospam nospamlaeeth.com> writes:
 yum install fedora-repos-rawhide
 yum install binutils --enablerepo rawhide
 objdump -v
sorry. should be: yum install fedora-release-rawhide yum install binutils --enablerepo rawhide objdump -v
Jan 20 2015