本文整理汇总了C++中ModuleList::GetModuleAtIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleList::GetModuleAtIndex方法的具体用法?C++ ModuleList::GetModuleAtIndex怎么用?C++ ModuleList::GetModuleAtIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleList
的用法示例。
在下文中一共展示了ModuleList::GetModuleAtIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: module_sp
void
SearchFilter::SearchInModuleList (Searcher &searcher, ModuleList &modules)
{
SymbolContext empty_sc;
if (m_target_sp == NULL)
return;
empty_sc.target_sp = m_target_sp;
if (searcher.GetDepth() == Searcher::eDepthTarget)
searcher.SearchCallback (*this, empty_sc, NULL, false);
else
{
const size_t numModules = modules.GetSize();
for (size_t i = 0; i < numModules; i++)
{
ModuleSP module_sp(modules.GetModuleAtIndex(i));
if (ModulePasses(module_sp))
{
if (DoModuleIteration(module_sp, searcher) == Searcher::eCallbackReturnStop)
return;
}
}
}
}
示例2: locker
void
AppleObjCRuntime::ReadObjCLibraryIfNeeded (const ModuleList &module_list)
{
if (!HasReadObjCLibrary ())
{
Mutex::Locker locker (module_list.GetMutex ());
size_t num_modules = module_list.GetSize();
for (size_t i = 0; i < num_modules; i++)
{
auto mod = module_list.GetModuleAtIndex (i);
if (IsModuleObjCLibrary (mod))
{
ReadObjCLibrary (mod);
break;
}
}
}
}
示例3: module_sp
void
Breakpoint::ModulesChanged (ModuleList &module_list, bool load)
{
if (load)
{
// The logic for handling new modules is:
// 1) If the filter rejects this module, then skip it.
// 2) Run through the current location list and if there are any locations
// for that module, we mark the module as "seen" and we don't try to re-resolve
// breakpoint locations for that module.
// However, we do add breakpoint sites to these locations if needed.
// 3) If we don't see this module in our breakpoint location list, call ResolveInModules.
ModuleList new_modules; // We'll stuff the "unseen" modules in this list, and then resolve
// them after the locations pass. Have to do it this way because
// resolving breakpoints will add new locations potentially.
const size_t num_locs = m_locations.GetSize();
for (size_t i = 0; i < module_list.GetSize(); i++)
{
bool seen = false;
ModuleSP module_sp (module_list.GetModuleAtIndex (i));
if (!m_filter_sp->ModulePasses (module_sp))
continue;
for (size_t loc_idx = 0; loc_idx < num_locs; loc_idx++)
{
BreakpointLocationSP break_loc = m_locations.GetByIndex(loc_idx);
if (!break_loc->IsEnabled())
continue;
const Section *section = break_loc->GetAddress().GetSection();
if (section == NULL || section->GetModule() == module_sp.get())
{
if (!seen)
seen = true;
if (!break_loc->ResolveBreakpointSite())
{
LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS));
if (log)
log->Printf ("Warning: could not set breakpoint site for breakpoint location %d of breakpoint %d.\n",
break_loc->GetID(), GetID());
}
}
}
if (!seen)
new_modules.AppendIfNeeded (module_sp);
}
if (new_modules.GetSize() > 0)
{
ResolveBreakpointInModules(new_modules);
}
}
else
{
// Go through the currently set locations and if any have breakpoints in
// the module list, then remove their breakpoint sites.
// FIXME: Think about this... Maybe it's better to delete the locations?
// Are we sure that on load-unload-reload the module pointer will remain
// the same? Or do we need to do an equality on modules that is an
// "equivalence"???
for (size_t i = 0; i < module_list.GetSize(); i++)
{
ModuleSP module_sp (module_list.GetModuleAtIndex (i));
if (m_filter_sp->ModulePasses (module_sp))
{
const size_t num_locs = m_locations.GetSize();
for (size_t loc_idx = 0; loc_idx < num_locs; ++loc_idx)
{
BreakpointLocationSP break_loc = m_locations.GetByIndex(loc_idx);
const Section *section = break_loc->GetAddress().GetSection();
if (section && section->GetModule() == module_sp.get())
{
// Remove this breakpoint since the shared library is
// unloaded, but keep the breakpoint location around
// so we always get complete hit count and breakpoint
// lifetime info
break_loc->ClearBreakpointSite();
}
}
}
}
}
}