Make some libstd++ formatters safer
authorWalter Erquinigo <wallace@fb.com>
Tue, 23 Nov 2021 17:32:30 +0000 (09:32 -0800)
committerWalter Erquinigo <wallace@fb.com>
Tue, 23 Nov 2021 21:52:32 +0000 (13:52 -0800)
commita48501150b9ef64fd61d24f8cef2645237facc44
tree4514fc801a5bd84715aefa83582a4e698f49e1ac
parent4ba5da8e3d38f38ed7845c22baadd8908729c520
Make some libstd++ formatters safer

We need to add checks that ensure that some core variables are valid, so
that we avoid printing out garbage data. The worst that could happen is
that an non-initialized variable is being printed as something with
123123432 children instead of 0.

Differential Revision: https://reviews.llvm.org/D114458
lldb/examples/synthetic/gnu_libstdcpp.py
lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/TestDataFormatterGenericUnordered.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/main.cpp