[lldb-dev] [Bug 15301] New: LLDB prints incorrect size of libstdc++ vector<bool> containers (when inferior built with GCC on Linux)

Greg Clayton gclayton at apple.com
Wed May 15 14:08:35 PDT 2013


What are the chances that these patches could affect other correctly emitted DWARF for templates? 

Unless this patch will _absolutely_ _never_ affect any correct debug info that is emitted by GCC, I would rather not fix this in LLDB, but just get GCC fixed.

Greg


On May 15, 2013, at 1:50 PM, Yacine Belkadi <yacine.belkadi.1 at gmail.com> wrote:

> Hi,
> 
> When the inferior is built with GCC 4.7.2, the DWARF contains duplicate
> DW_AT_template_type_param DIEs for std::vector (and others). There is a
> reported GCC bug about it (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54410).
> Because of this, lldb parses the type
> "std::vector<bool, std::allocator<bool> >" as
> "std::vector<bool, std::allocator<bool, bool>, bool, std::allocator<bool,
> bool> >".
> Later, the FormatManager fails to match this type with the appropriate
> SyntheticChildrenFrontEnd for std::vector<bool>. The printable
> representation produced is then the incorrect:
> (lldb) frame variable vBool
> (std::vector<bool, std::allocator<bool, bool>, bool, std::allocator<bool,
> bool> >) vBool = size=0 {}
> 
> I've attached 3 patches (against r181819) for review:
> - An attempt at a workaround for the GCC bug
> - A change in the FormatManager to allow "std::vector<bool,
>  std:allocator<bool> >" to be matched to the vector<bool> Synthetic.
> - The re-enabling of the test case
> 
> Thanks,
> Yacine
> 
>> http://llvm.org/bugs/show_bug.cgi?id=15301
>> 
>>            Bug ID: 15301
>>           Summary: LLDB prints incorrect size of libstdc++ vector<bool>
>>                    containers (when inferior built with GCC on Linux)
>>           Product: lldb
>>           Version: unspecified
>>          Hardware: PC
>>                OS: Linux
>>            Status: NEW
>>          Severity: enhancement
>>          Priority: P
>>         Component: All Bugs
>>          Assignee: lldb-dev at cs.uiuc.edu
>>          Reporter: daniel.malea at intel.com
>>    Classification: Unclassified
>> 
>> In the TestDataFormatterStdVBool, instead of printing the correct size
>> (49) lldb prints -1 for the size of the std::vector<bool> container
>> (libstdc++).
>> 
>> To reproduce, run:
>> 
>> python dotest.py
>> functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool -C gcc
>> 
>> -- 
>> You are receiving this mail because:
>> You are the assignee for the bug.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://lists.cs.uiuc.edu/pipermail/lldb-dev/attachments/20130219/8ff9c75c/attachment-0001.html>
> 
> 
> 
> 
> <0001-SymbolFile-DWARF-Ignore-duplicate-template-parameter.patch><0002-FormatManager-Match-std-vector-bool-std-allocator-bo.patch><0003-Tests-Re-enable-TestDataFormatterStdVBool.py.patch>_______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list