[llvm-dev] [cfe-dev] Emiting linkage names for Types to Debuginfo (C++ RTTI support in GDB/LLDB)

Roman Popov via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 2 19:55:07 PST 2018


Here is result of experiment:

(Original size , with DW_AT_linkage_name for composites, % increase)
clang-7.0 1926574256 1952846192   1.4%
clang-tidy 1220980360 1238498112   1.4%
llvm-mt  7404728 7525328 1.6 %
std::cout << "hello world!" 21552 22080  2.4 %

IMO, not that big price for reliable dynamic type identification (Full
disclosure: I need depend on this feature, since I'm writing Python pretty
printers for GDB )

-Roman

2018-03-02 18:12 GMT-08:00 Roman Popov <ripopov at gmail.com>:

> Mangled names can be long indeed, but pretty-printed types are also long.
> I can evaluate effect on size on clang codebase itself.
>
> If you disable RTTI, than obviously you can't use it. So if RTTI is
> disabled, we can disable mangled names in DWARF. Clang is compiled without
> standard C++ RTTI because it has it's own RTTI. In general, however, many
> libraries use standard RTTI.
>
>
>
> 2018-03-02 17:43 GMT-08:00 <paul.robinson at sony.com>:
>
>> > Currently what debugger has to do is to demangle RTTI name and try to
>> > match it to DW_AT_name attribute to find type. As you can see it does
>> > not work for any of 3 examples.
>> >
>> > I've asked about the problem on G++ maillist, and one of the proposed
>> > solutions is to emit DW_AT_linkage_name for types.
>> >
>> > Can this solution be also implemented in LLVM?
>>
>> It could, but mangled names can be very long and we need to consider
>> whether the additional size cost is worth it under various conditions.
>> For example, does this type matching work when a program is compiled
>> with `-fno-rtti`?  (Clang itself is compiled this way by default.)
>> Thanks,
>> --paulr
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180302/6e5b84ce/attachment.html>


More information about the llvm-dev mailing list