================
@@ -125,28 +125,44 @@ ValueObject
*ValueObjectRegisterSet::CreateChildAtIndex(size_t idx) {
return nullptr;
}
+std::optional<std::pair<size_t, const RegisterInfo *>>
+ValueObjectRegisterSet::LookupChildWithName(llvm::StringRef name) {
+ if (!m_reg_ctx_sp || !m_reg_set)
+ return {};
+
+ // See if the register exists at all in any set.
+ const RegisterInfo *reg_info = m_reg_ctx_sp->GetRegisterInfoByName(name);
+ if (!reg_info)
+ return {};
+
+ // See if this register is in this register set.
+ for (size_t i = 0; i < m_reg_set->num_registers; ++i) {
+ const RegisterInfo *contained_reg_info =
+ m_reg_ctx_sp->GetRegisterInfoAtIndex(m_reg_set->registers[i]);
+ if (contained_reg_info == reg_info)
----------------
DavidSpickett wrote:
Here I tried using the "kinds" part of the register info. Comparing it to the
indexes contained in the register set. Turns out that the two are not
necessarily in the same sets.
https://github.com/llvm/llvm-project/pull/212727
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits