Fix tuple getter in std unique pointer pretty-printer
Summary: Check case when _M_t child member is not present. Reviewers: labath, tberghammer Reviewed By: labath, tberghammer Differential Revision: https://reviews.llvm.org/D47932 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com>. llvm-svn: 334411
This commit is contained in:
parent
4410e2c43f
commit
cb512a3072
|
@ -0,0 +1,5 @@
|
|||
import lldbsuite.test.lldbinline as lldbinline
|
||||
from lldbsuite.test.decorators import *
|
||||
|
||||
lldbinline.MakeInlineTest(__file__, globals(), [no_debug_info_test])
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
// Test that we don't crash when trying to pretty-print structures that don't
|
||||
// have the layout our data formatters expect.
|
||||
namespace std {
|
||||
template<typename T, typename Deleter = void>
|
||||
class unique_ptr {};
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::unique_ptr<int> U;
|
||||
return 0; //% self.expect("frame variable U", substrs=["unique_ptr", "{}"])
|
||||
}
|
|
@ -67,6 +67,8 @@ ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetTuple() {
|
|||
|
||||
ValueObjectSP obj_child_sp =
|
||||
valobj_sp->GetChildMemberWithName(ConstString("_M_t"), true);
|
||||
if (!obj_child_sp)
|
||||
return nullptr;
|
||||
|
||||
ValueObjectSP obj_subchild_sp =
|
||||
obj_child_sp->GetChildMemberWithName(ConstString("_M_t"), true);
|
||||
|
|
Loading…
Reference in New Issue