Add an API on SBValueList to find the first value with a given name stored in the list
llvm-svn: 222576
This commit is contained in:
parent
91ffec908f
commit
e9a09c74fa
|
@ -43,6 +43,9 @@ public:
|
|||
|
||||
lldb::SBValue
|
||||
GetValueAtIndex (uint32_t idx) const;
|
||||
|
||||
lldb::SBValue
|
||||
GetValueByName (const char* name) const;
|
||||
|
||||
lldb::SBValue
|
||||
FindValueObjectByUID (lldb::user_id_t uid);
|
||||
|
|
|
@ -96,6 +96,10 @@ public:
|
|||
|
||||
lldb::SBValue
|
||||
FindValueObjectByUID (lldb::user_id_t uid);
|
||||
|
||||
lldb::SBValue
|
||||
GetValueByName (const char* name) const;
|
||||
|
||||
%pythoncode %{
|
||||
def __len__(self):
|
||||
return int(self.GetSize())
|
||||
|
|
|
@ -78,6 +78,21 @@ public:
|
|||
}
|
||||
return lldb::SBValue();
|
||||
}
|
||||
|
||||
lldb::SBValue
|
||||
GetValueByName (const char* name) const
|
||||
{
|
||||
if (name)
|
||||
{
|
||||
for (auto val : m_values)
|
||||
{
|
||||
if (val.IsValid() && val.GetName() &&
|
||||
strcmp(name,val.GetName()) == 0)
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return lldb::SBValue();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<lldb::SBValue> m_values;
|
||||
|
@ -261,6 +276,15 @@ SBValueList::FindValueObjectByUID (lldb::user_id_t uid)
|
|||
return sb_value;
|
||||
}
|
||||
|
||||
SBValue
|
||||
SBValueList::GetValueByName (const char* name) const
|
||||
{
|
||||
SBValue sb_value;
|
||||
if (m_opaque_ap.get())
|
||||
sb_value = m_opaque_ap->GetValueByName(name);
|
||||
return sb_value;
|
||||
}
|
||||
|
||||
void *
|
||||
SBValueList::opaque_ptr ()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue