本文整理汇总了C++中ArchSpec::IsCompatibleMatch方法的典型用法代码示例。如果您正苦于以下问题:C++ ArchSpec::IsCompatibleMatch方法的具体用法?C++ ArchSpec::IsCompatibleMatch怎么用?C++ ArchSpec::IsCompatibleMatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArchSpec
的用法示例。
在下文中一共展示了ArchSpec::IsCompatibleMatch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveInvalidLocations
void BreakpointLocationList::RemoveInvalidLocations(const ArchSpec &arch) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
size_t idx = 0;
// Don't cache m_location.size() as it will change since we might remove
// locations from our vector...
while (idx < m_locations.size()) {
BreakpointLocation *bp_loc = m_locations[idx].get();
if (bp_loc->GetAddress().SectionWasDeleted()) {
// Section was deleted which means this breakpoint comes from a module
// that is no longer valid, so we should remove it.
RemoveLocationByIndex(idx);
continue;
}
if (arch.IsValid()) {
ModuleSP module_sp(bp_loc->GetAddress().GetModule());
if (module_sp) {
if (!arch.IsCompatibleMatch(module_sp->GetArchitecture())) {
// The breakpoint was in a module whose architecture is no longer
// compatible with "arch", so we need to remove it
RemoveLocationByIndex(idx);
continue;
}
}
}
// Only increment the index if we didn't remove the locations at index
// "idx"
++idx;
}
}
示例2: module_sp
ObjectFileSP
ObjectContainerUniversalMachO::GetObjectFile(const FileSpec *file) {
uint32_t arch_idx = 0;
ArchSpec arch;
// If the module hasn't specified an architecture yet, set it to the default
// architecture:
ModuleSP module_sp(GetModule());
if (module_sp) {
if (!module_sp->GetArchitecture().IsValid()) {
arch = Target::GetDefaultArchitecture();
if (!arch.IsValid())
arch.SetTriple(LLDB_ARCH_DEFAULT);
} else
arch = module_sp->GetArchitecture();
ArchSpec curr_arch;
// First, try to find an exact match for the Arch of the Target.
for (arch_idx = 0; arch_idx < m_header.nfat_arch; ++arch_idx) {
if (GetArchitectureAtIndex(arch_idx, curr_arch) &&
arch.IsExactMatch(curr_arch))
break;
}
// Failing an exact match, try to find a compatible Arch of the Target.
if (arch_idx >= m_header.nfat_arch) {
for (arch_idx = 0; arch_idx < m_header.nfat_arch; ++arch_idx) {
if (GetArchitectureAtIndex(arch_idx, curr_arch) &&
arch.IsCompatibleMatch(curr_arch))
break;
}
}
if (arch_idx < m_header.nfat_arch) {
DataBufferSP data_sp;
lldb::offset_t data_offset = 0;
return ObjectFile::FindPlugin(
module_sp, file, m_offset + m_fat_archs[arch_idx].offset,
m_fat_archs[arch_idx].size, data_sp, data_offset);
}
}
return ObjectFileSP();
}
示例3:
//------------------------------------------------------------------
/// Lets a platform answer if it is compatible with a given
/// architecture and the target triple contained within.
//------------------------------------------------------------------
bool
Platform::IsCompatibleArchitecture (const ArchSpec &arch, bool exact_arch_match, ArchSpec *compatible_arch_ptr)
{
// If the architecture is invalid, we must answer true...
if (arch.IsValid())
{
ArchSpec platform_arch;
// Try for an exact architecture match first.
if (exact_arch_match)
{
for (uint32_t arch_idx=0; GetSupportedArchitectureAtIndex (arch_idx, platform_arch); ++arch_idx)
{
if (arch.IsExactMatch(platform_arch))
{
if (compatible_arch_ptr)
*compatible_arch_ptr = platform_arch;
return true;
}
}
}
else
{
for (uint32_t arch_idx=0; GetSupportedArchitectureAtIndex (arch_idx, platform_arch); ++arch_idx)
{
if (arch.IsCompatibleMatch(platform_arch))
{
if (compatible_arch_ptr)
*compatible_arch_ptr = platform_arch;
return true;
}
}
}
}
if (compatible_arch_ptr)
compatible_arch_ptr->Clear();
return false;
}