[Lldb-commits] [lldb] [lldb] Upgrade `GetIndexOfChildWithName` to use `llvm::Expected` (PR #136693)
Augusto Noronha via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 22 13:48:24 PDT 2025
================
@@ -489,7 +490,10 @@ llvm::Error Interpret(std::vector<ControlStackElement> &control,
TYPE_CHECK(Object, String);
auto name = data.Pop<std::string>();
POP_VALOBJ(valobj);
- data.Push((uint64_t)valobj->GetIndexOfChildWithName(name));
+ auto index_or_err = valobj->GetIndexOfChildWithName(name);
----------------
augusto2112 wrote:
```
if (auto index_or_err = valobj->GetIndexOfChildWithName(name))
data.Push((uint64_t)*index_or_err);
else
return index_or_err.takeError();
```
https://github.com/llvm/llvm-project/pull/136693
More information about the lldb-commits
mailing list