Hello! We want to implement in-process symbolizer for {Address,Thread}Sanitizer testing tools that would be based on LLVM libraries. I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ names. Is it true, that LLVM doesn't have the code that is capable of that, and if yes, are there any plans to add it? Depending on something like libiberty.a doesn't seem like a good or portable solution. -- Alexey Samsonov, MSK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120704/8ae9cc20/attachment.html>
On Jul 4, 2012, at 8:33 AM, Alexey Samsonov wrote:> Hello! > > We want to implement in-process symbolizer for {Address,Thread}Sanitizer testing tools that would be based on LLVM libraries. > I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ names. Is it true, that LLVM doesn't have the code that is capable > of that, and if yes, are there any plans to add it? > Depending on something like libiberty.a doesn't seem like a good or portable solution.There's code to demangle names in libcxxabi. -- Marshall Marshall Clow Idio Software <mailto:mclow.lists at gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
On Wed, Jul 4, 2012 at 8:01 PM, Marshall Clow <mclow.lists at gmail.com> wrote:> On Jul 4, 2012, at 8:33 AM, Alexey Samsonov wrote: > > > Hello! > > > > We want to implement in-process symbolizer for {Address,Thread}Sanitizer > testing tools that would be based on LLVM libraries. > > I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ > names. Is it true, that LLVM doesn't have the code that is capable > > of that, and if yes, are there any plans to add it? > > Depending on something like libiberty.a doesn't seem like a good or > portable solution. > > There's code to demangle names in libcxxabi. >Indeed, thanks! I'll take a closer look at it.> > -- Marshall > > Marshall Clow Idio Software <mailto:mclow.lists at gmail.com> > > A.D. 1517: Martin Luther nails his 95 Theses to the church door and is > promptly moderated down to (-1, Flamebait). > -- Yu Suzuki > >-- Alexey Samsonov, MSK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120704/a74d043b/attachment.html>
On Wed, Jul 4, 2012 at 8:33 AM, Alexey Samsonov <samsonov at google.com> wrote:> Hello! > > We want to implement in-process symbolizer for {Address,Thread}Sanitizer > testing tools that would be based on LLVM libraries. > I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ > names. Is it true, that LLVM doesn't have the code that is capable > of that, and if yes, are there any plans to add it? > Depending on something like libiberty.a doesn't seem like a good or portable > solution. > > -- > Alexey Samsonov, MSK >Yes, LLVM currently has no C++ demangler, and it needs one. Although I have no idea where it should live. It would be nice if it could live in clang next to the mangler, but clang doesn't even need a demangler. llvm tools, lld, and compiler-rt do. - Michael Spencer
On Wed, Jul 4, 2012 at 11:43 PM, Michael Spencer <bigcheesegs at gmail.com>wrote:> On Wed, Jul 4, 2012 at 8:33 AM, Alexey Samsonov <samsonov at google.com> > wrote: > > Hello! > > > > We want to implement in-process symbolizer for {Address,Thread}Sanitizer > > testing tools that would be based on LLVM libraries. > > I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ > > names. Is it true, that LLVM doesn't have the code that is capable > > of that, and if yes, are there any plans to add it? > > Depending on something like libiberty.a doesn't seem like a good or > portable > > solution. > > > > -- > > Alexey Samsonov, MSK > > > > Yes, LLVM currently has no C++ demangler, and it needs one. Although I > have no idea where it should live. It would be nice if it could live > in clang next to the mangler, but clang doesn't even need a demangler. > llvm tools, lld, and compiler-rt do.llvm/Support? It's not that clear how libcxxabi could be used in llvm tools, as IIUC this library is built independently. The demangler implementation there is 10 KLOC which are rather far from LLVM style. -- Alexey Samsonov, MSK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120705/63a316dd/attachment.html>
On Jul 4, 2012, at 12:43 PM, Michael Spencer wrote:> On Wed, Jul 4, 2012 at 8:33 AM, Alexey Samsonov <samsonov at google.com> wrote: >> Hello! >> >> We want to implement in-process symbolizer for {Address,Thread}Sanitizer >> testing tools that would be based on LLVM libraries. >> I've noticed that llvm-nm (as well as other tools) doesn't demangle C++ >> names. Is it true, that LLVM doesn't have the code that is capable >> of that, and if yes, are there any plans to add it? >> Depending on something like libiberty.a doesn't seem like a good or portable >> solution. >> >> -- >> Alexey Samsonov, MSK >> > > Yes, LLVM currently has no C++ demangler, and it needs one. Although I > have no idea where it should live. It would be nice if it could live > in clang next to the mangler, but clang doesn't even need a demangler. > llvm tools, lld, and compiler-rt do.libc++abi provides a full C++ demangler, along with an extended API that provides a tree-based representation of the demangled name (implemented for LLDB). http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/cxa_demangle.h?revision=HEAD&view=markup On Jul 4, 2012, at 10:08 PM, Chandler Carruth wrote:> In the same way that the core LLVM libraries have support routines for DWARF, I think that both mangling and demangling should be provided as well.You can't really implement mangling without a full C++ (or whatever) AST of some sort to come from. Demangling is a much easier problem, at least structurally. :) -Chris