[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 15 00:12:24 PDT 2021
jankratochvil created this revision.
jankratochvil added reviewers: teemperor, dblaikie, clayborg.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.
This is a part of D101237 <https://reviews.llvm.org/D101237> to fix LLDB testsuite with GCC 11 installed (and its libstdc++). Any non-trivial handling of `std::unique_ptr` still asserts LLDB, that is the rest of D101237 <https://reviews.llvm.org/D101237>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D104283
Files:
lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
Index: lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
===================================================================
--- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,12 @@
if (ptr_obj)
m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
- ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
- if (del_obj)
- m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+ // GCC 11 std::default_delete<...> has existing child with GetByteSize()==1.
+ if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+ if (del_obj)
+ m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+ }
if (m_ptr_obj) {
Status error;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104283.352053.patch
Type: text/x-patch
Size: 856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210615/c47fa223/attachment.bin>
More information about the lldb-commits
mailing list