<rdar://problem/13021266>

Adding FindFirstGlobalVariable to SBModule and SBTarget
These calls work like FindGlobalVariables but they only return the first match found and so they can return an SBValue instead of an SBValueList for added convenience of use

llvm-svn: 172636
This commit is contained in:
Enrico Granata
2013-01-16 18:53:52 +00:00
parent 77f49a4902
commit bcd80b4723
6 changed files with 80 additions and 0 deletions

View File

@@ -480,6 +480,15 @@ SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_
return sb_value_list;
}
lldb::SBValue
SBModule::FindFirstGlobalVariable (lldb::SBTarget &target, const char *name)
{
SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
return sb_value_list.GetValueAtIndex(0);
return SBValue();
}
lldb::SBType
SBModule::FindFirstType (const char *name_cstr)
{