[Lldb-commits] [lldb] draft: [lldb] Upgrade ValueObject::GetData to return llvm::Expected (PR #130516)

Julius Alexandre via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 10 16:48:41 PDT 2025


================
@@ -68,11 +68,9 @@ static bool CharStringSummaryProvider(ValueObject &valobj, Stream &stream) {
 
 template <StringElementType ElemType>
 static bool CharSummaryProvider(ValueObject &valobj, Stream &stream) {
-  DataExtractor data;
-  Status error;
-  valobj.GetData(data, error);
+  auto data_or_err = valobj.GetData();
 
-  if (error.Fail())
+  if (!data_or_err)
----------------
wizardengineer wrote:

Okay that makes sense, I was aware of the assertion of `llvm::Error`. I'll make sure to fix that and resort to handling the Errors if needed so. Otherwise, I'll use `llvm::expectedToOptional()`. Just to be sure, in what case would I know if a error doesn't really matter? 

https://github.com/llvm/llvm-project/pull/130516


More information about the lldb-commits mailing list