From a2f55fde28688740241caba2f2023fcb1d68555e Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 21 Nov 2024 15:38:49 -0800 Subject: [PATCH] [lldb] Fix a regression in SBValue::GetObjectDescription() (#117242) The old behavior was to return a null string in the error case,when refactoring the error handling I thought it would be a good idea to print the error in the description, but that breaks clients that try to print a description first and then do something else in the error case. The API is not great but it's clear that in-band errors are also not a good idea. rdar://133956263 (cherry picked from commit 7553fb127485d034e2ffdbb5461fef2b6f04b989) Conflicts: lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py (cherry picked from commit 091aa235f87b0fd874f84ab29801f718d11fdfca) --- lldb/test/API/lang/swift/po/uninitialized/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/test/API/lang/swift/po/uninitialized/main.swift b/lldb/test/API/lang/swift/po/uninitialized/main.swift index dae351a05d002..f1a2972efc91d 100644 --- a/lldb/test/API/lang/swift/po/uninitialized/main.swift +++ b/lldb/test/API/lang/swift/po/uninitialized/main.swift @@ -15,7 +15,7 @@ class POClass { func main() { var object: POClass - object = POClass() //% self.assertTrue(self.frame().FindVariable('object').GetObjectDescription() == 'error: ', 'po correctly detects uninitialized instances') + object = POClass() //% self.assertEqual(self.frame().FindVariable('object').GetObjectDescription(), None, 'po correctly detects uninitialized instances'); self.expect("po object", substrs=[""]) print("yay I am done") //% self.assertTrue('POClass:' in self.frame().FindVariable('object').GetObjectDescription()) }