C++ demangler for llvm tools

Hi,

AFAIK, the tools “symbolizer, objdump and nm” need a demangler.

I see there is libcxxabi which provides the demangle library. But there is no support to build libcxxabi on windows with MSVC.

This left a huge void and my symbolizer cannot work on Windows if built with MSVC.

Instead of mucking around OS dependencies, why shouldn’t we have a demangle library in LLVM.

I already have this implementation locally and it works fine for me on both Linux and Windows.

Any thoughts ?

–Sumanth G

This has come up before. The best candidate is likely not the demangler in libcxxabi, but the demangler that used to be in libcxxabi but was determined to be too heavy. This demangler was designed to be flexible and useful in a much wider context.

David

What if I resurrect that version and keep it in lib/Support ?
I think I already have that specific version of demangler.

--Sumanth G

Hi,

      AFAIK, the tools “symbolizer, objdump and nm” need a demangler.

I see there is libcxxabi which provides the demangle library. But there is
no support to build libcxxabi on windows with MSVC.

This left a huge void and my symbolizer cannot work on Windows if built with
MSVC.

Instead of mucking around OS dependencies, why shouldn’t we have a demangle
library in LLVM.

I already have this implementation locally and it works fine for me on both
Linux and Windows.

Any thoughts ?

Lots of people want this, but nobody has had the time yet. It would
need to support both the itanium and msvc manglings, and be resilient
against malicious mangled names (it's possible to construct ~200 byte
names that expand out to multiple GiBs).

- Michael Spencer

> Hi,
>
> AFAIK, the tools “symbolizer, objdump and nm” need a demangler.
>
> I see there is libcxxabi which provides the demangle library. But there
is
> no support to build libcxxabi on windows with MSVC.
>
> This left a huge void and my symbolizer cannot work on Windows if built
with
> MSVC.
>
>
>
> Instead of mucking around OS dependencies, why shouldn’t we have a
demangle
> library in LLVM.
>
> I already have this implementation locally and it works fine for me on
both
> Linux and Windows.
>
>
>
> Any thoughts ?

Lots of people want this, but nobody has had the time yet. It would
need to support both the itanium and msvc manglings, and be resilient
against malicious mangled names (it's possible to construct ~200 byte
names that expand out to multiple GiBs).

Since the itanium and msvc ones are going to be completely separate code
paths, it probably makes sense as an incremental step to do just itanium,
since it seems we already know of a couple implementations we could
integrate.

-- Sean Silva

> Hi,
>
> AFAIK, the tools “symbolizer, objdump and nm” need a
demangler.
>
> I see there is libcxxabi which provides the demangle library. But
there
is
> no support to build libcxxabi on windows with MSVC.
>
> This left a huge void and my symbolizer cannot work on Windows if
built
with
> MSVC.
>
>
>
> Instead of mucking around OS dependencies, why shouldn’t we have a
demangle
> library in LLVM.
>
> I already have this implementation locally and it works fine for me on
both
> Linux and Windows.
>
>
>
> Any thoughts ?

Lots of people want this, but nobody has had the time yet. It would
need to support both the itanium and msvc manglings, and be resilient
against malicious mangled names (it's possible to construct ~200 byte
names that expand out to multiple GiBs).

Since the itanium and msvc ones are going to be completely separate code
paths, it probably makes sense as an incremental step to do just itanium,
since it seems we already know of a couple implementations we could
integrate.

If you guys are okay with it, I can push the C++ demangler to lib/Support.
Any additional functionality can go on top of that.
How different is Itanium demangler to that of C++ demangler (libcxxabi)