[Lldb-commits] [lldb] [lldb] Return index of element in ValueObject path instead of the element's value (PR #74413)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 5 10:09:52 PST 2023


================
@@ -398,13 +398,16 @@ ValueObject::GetChildAtIndexPath(llvm::ArrayRef<size_t> idxs,
   if (idxs.size() == 0)
     return GetSP();
   ValueObjectSP root(GetSP());
+
+  size_t current_index = 0;
   for (size_t idx : idxs) {
     root = root->GetChildAtIndex(idx);
     if (!root) {
       if (index_of_error)
-        *index_of_error = idx;
+        *index_of_error = current_index;
       return root;
     }
+    current_index += 1;
----------------
chelcassanova wrote:

This is the tiniest nit on earth but `current_index++` here to increment this?

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


More information about the lldb-commits mailing list