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

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 17 14:23:53 PDT 2025


================
@@ -273,15 +273,13 @@ ValueObjectSP ForwardListFrontEnd::GetChildAtIndex(uint32_t idx) {
 
   // we need to copy current_sp into a new object otherwise we will end up with
   // all items named __value_
-  DataExtractor data;
-  Status error;
-  current_sp->GetData(data, error);
-  if (error.Fail())
+  auto data_or_err = current_sp->GetData();
+  if (!data_or_err)
     return nullptr;
----------------
adrian-prantl wrote:

missing taking the error here. This would be a good use for `llvm::expectedToOptional()` since we're just dropping the error here.

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


More information about the lldb-commits mailing list