[all-commits] [llvm/llvm-project] 4ba5da: Improve optional formatter

walter erquinigo via All-commits all-commits at lists.llvm.org
Tue Nov 23 13:58:45 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ba5da8e3d38f38ed7845c22baadd8908729c520
      https://github.com/llvm/llvm-project/commit/4ba5da8e3d38f38ed7845c22baadd8908729c520
  Author: Walter Erquinigo <wallace at fb.com>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M lldb/examples/synthetic/gnu_libstdcpp.py
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/optional/TestDataFormatterGenericOptional.py

  Log Message:
  -----------
  Improve optional formatter

As suggested by @labath in https://reviews.llvm.org/D114403, we should
make the formatter more resilient to corrupted data. The Libcxx version
explicitly checks for engaged = 1, so we can do that as well for safety.

Differential Revision: https://reviews.llvm.org/D114450


  Commit: a48501150b9ef64fd61d24f8cef2645237facc44
      https://github.com/llvm/llvm-project/commit/a48501150b9ef64fd61d24f8cef2645237facc44
  Author: Walter Erquinigo <wallace at fb.com>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M lldb/examples/synthetic/gnu_libstdcpp.py
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/TestDataFormatterGenericUnordered.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/main.cpp

  Log Message:
  -----------
  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


Compare: https://github.com/llvm/llvm-project/compare/892648b18a8c...a48501150b9e


More information about the All-commits mailing list