Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lldb/source/API/SBValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ const char *SBValue::GetObjectDescription() {
return nullptr;

llvm::Expected<std::string> str = value_sp->GetObjectDescription();
if (!str)
return ConstString("error: " + toString(str.takeError())).AsCString();
if (!str) {
llvm::consumeError(str.takeError());
return nullptr;
}
return ConstString(*str).AsCString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def test_error_type(self):
value = frame.EvaluateExpression('#error("I am error.")')
error = value.GetError()
self.assertEqual(error.GetType(), lldb.eErrorTypeExpression)
value = frame.FindVariable("f")
self.assertTrue(value.IsValid())
desc = value.GetObjectDescription()
self.assertEqual(desc, None)

def test_command_expr_sbdata(self):
"""Test the structured diagnostics data"""
Expand Down
Loading