On Thu, Mar 1, 2018 at 3:26 PM, Andrew Pinski <pins...@gmail.com> wrote: > On Thu, Mar 1, 2018 at 12:18 PM, Roman Popov <ripo...@gmail.com> wrote: >> Is there any progress on this problem? >> >> I'm not familiar with G++ , but I have little experience with LLVM. I can >> try make LLVM emitting mangled names to DW_AT_name, instead of demangled >> ones. >> This way GDB can match DW_AT_name against RTTI. And for display it can >> call abi::__cxa_demangle(name, NULL, NULL, &status), from #include >> <cxxabi.h>. >> >> Will it work? > > > Reading http://wiki.dwarfstd.org/index.php?title=Best_Practices: > the DW_AT_name attribute should contain the name of the corresponding > program object as it appears in the source code, without any > qualifiers such as namespaces, containing classes, or modules (see > Section 2.15). A consumer can easily reconstruct the fully-qualified > name from the DIE hierarchy. In general, the value of DW_AT_name > should be such that a fully-qualified name constructed from the > DW_AT_name attributes of the object and its containing objects will > uniquely represent that object in a form natural to the source > language. > > > So having the mangled symbol in DW_AT_name seems backwards and not the > point of it.
If we add the mangled name, which seems reasonable, it should be in DW_AT_linkage_name. Jason