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

Yacine Belkadi yacine.belkadi.1 at gmail.com
Wed May 15 13:50:58 PDT 2013


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>




-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SymbolFile-DWARF-Ignore-duplicate-template-parameter.patch
Type: text/x-patch
Size: 5017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130515/7478b4e6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-FormatManager-Match-std-vector-bool-std-allocator-bo.patch
Type: text/x-patch
Size: 3238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130515/7478b4e6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Tests-Re-enable-TestDataFormatterStdVBool.py.patch
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130515/7478b4e6/attachment-0002.bin>


More information about the lldb-dev mailing list