Skip to content

Commit 1fa3422

Browse files
author
git apple-llvm automerger
committed
Merge commit 'db02b99c038a' from swift/release/6.1 into stable/20240723
2 parents e8960a7 + db02b99 commit 1fa3422

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lldb/source/API/SBValue.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,10 @@ const char *SBValue::GetObjectDescription() {
380380
return nullptr;
381381

382382
llvm::Expected<std::string> str = value_sp->GetObjectDescription();
383-
if (!str)
384-
return ConstString("error: " + toString(str.takeError())).AsCString();
383+
if (!str) {
384+
llvm::consumeError(str.takeError());
385+
return nullptr;
386+
}
385387
return ConstString(*str).AsCString();
386388
}
387389

lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ def test_error_type(self):
195195
value = frame.EvaluateExpression('#error("I am error.")')
196196
error = value.GetError()
197197
self.assertEqual(error.GetType(), lldb.eErrorTypeExpression)
198+
value = frame.FindVariable("f")
199+
self.assertTrue(value.IsValid())
200+
desc = value.GetObjectDescription()
201+
self.assertEqual(desc, None)
198202

199203
def test_command_expr_sbdata(self):
200204
"""Test the structured diagnostics data"""

lldb/test/API/lang/swift/po/uninitialized/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class POClass {
1515

1616
func main() {
1717
var object: POClass
18-
object = POClass() //% self.assertTrue(self.frame().FindVariable('object').GetObjectDescription() == 'error: <uninitialized>', 'po correctly detects uninitialized instances')
18+
object = POClass() //% self.assertEqual(self.frame().FindVariable('object').GetObjectDescription(), None, 'po correctly detects uninitialized instances'); self.expect("po object", substrs=["<uninitialized>"])
1919
print("yay I am done") //% self.assertTrue('POClass:' in self.frame().FindVariable('object').GetObjectDescription())
2020
}
2121

0 commit comments

Comments
 (0)