[llvm-dev] VC C++ demangler

Martin J. O'Riordan via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 19 12:34:51 PDT 2017


A long time ago, when I devised the grammar and structure of the Microsoft C++ name mangling scheme (decorated names), the document describing the object model and the name decoration scheme were made publically available.  Perhaps this is still available publically, or perhaps Microsoft might be willing to share an up to date definition of the name-decoration grammar, especially in light of the integration of CodeView debugging information into LLVM, which somewhat ties in with this.

 

This was expressed as a regular BNF grammar, so it should be possible to create a clean-room implementation of both the “mangler” and “de-mangler” from that BNF definition if it still exists in that form.  Does the recently added CodeView debug information not provide this description (I admit I haven’t looked)?

 

Certainly tools like ‘c++filt’ do not know about the Microsoft name decoration scheme, but LLVM does know how to mangle the names using the VC++ ABI, and since the mangling follows a regular grammar, the de-mangling should be relatively straight-forward to implement.

 

All the best,

 

            MartinO

 

-----Original Message-----
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Davide Italiano via llvm-dev
Sent: 19 June 2017 19:00
To: Rui Ueyama <ruiu at google.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] VC C++ demangler

 

On Mon, Jun 19, 2017 at 10:53 AM, Rui Ueyama via llvm-dev < <mailto:llvm-dev at lists.llvm.org> llvm-dev at lists.llvm.org> wrote:

> Hi,

> 

> We have a demangler for the Itanium ABI, but looks like we don't have 

> one for the MSVC-style symbols. Is there any good demangler we can 

> import to LLVM?

> 

> If there's no suitable demangler, I'd like to write one. Currently, we 

> are using `UnDecorateSymbolName` function, but the function is 

> available only on Windows (which is problematic when you are doing a 

> cross-build), and the function is not thread-safe. These two seem to 

> be an enough reason to have our own demanler.

> 

 

I'm not aware of a suitable one, currently. I agree it would be very useful to have.

 

--

Davide

 

"There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare _______________________________________________

LLVM Developers mailing list

 <mailto:llvm-dev at lists.llvm.org> llvm-dev at lists.llvm.org

 <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170619/8d12252d/attachment.html>


More information about the llvm-dev mailing list