本文整理汇总了C++中Symtab::FindAllSymbolsWithNameAndType方法的典型用法代码示例。如果您正苦于以下问题:C++ Symtab::FindAllSymbolsWithNameAndType方法的具体用法?C++ Symtab::FindAllSymbolsWithNameAndType怎么用?C++ Symtab::FindAllSymbolsWithNameAndType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symtab
的用法示例。
在下文中一共展示了Symtab::FindAllSymbolsWithNameAndType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scoped_timer
size_t
Module::FindSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_type, SymbolContextList &sc_list)
{
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
Timer scoped_timer(__PRETTY_FUNCTION__,
"Module::FindSymbolsWithNameAndType (name = %s, type = %i)",
name.AsCString(),
symbol_type);
const size_t initial_size = sc_list.GetSize();
ObjectFile *objfile = GetObjectFile ();
if (objfile)
{
Symtab *symtab = objfile->GetSymtab();
if (symtab)
{
std::vector<uint32_t> symbol_indexes;
symtab->FindAllSymbolsWithNameAndType (name, symbol_type, symbol_indexes);
SymbolIndicesToSymbolContextList (symtab, symbol_indexes, sc_list);
}
}
return sc_list.GetSize() - initial_size;
}
示例2: module_sp
lldb::SBSymbolContextList
SBModule::FindSymbols (const char *name, lldb::SymbolType symbol_type)
{
SBSymbolContextList sb_sc_list;
if (name && name[0])
{
ModuleSP module_sp (GetSP ());
Symtab *symtab = GetUnifiedSymbolTable (module_sp);
if (symtab)
{
std::vector<uint32_t> matching_symbol_indexes;
const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type, matching_symbol_indexes);
if (num_matches)
{
SymbolContext sc;
sc.module_sp = module_sp;
SymbolContextList &sc_list = *sb_sc_list;
for (size_t i=0; i<num_matches; ++i)
{
sc.symbol = symtab->SymbolAtIndex (matching_symbol_indexes[i]);
if (sc.symbol)
sc_list.Append(sc);
}
}
}
}
return sb_sc_list;
}
示例3: sc
uint32_t
Module::FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
bool include_symbols,
bool include_inlines,
bool append,
SymbolContextList& sc_list)
{
if (!append)
sc_list.Clear();
const uint32_t start_size = sc_list.GetSize();
// Find all the functions (not symbols, but debug information functions...
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
symbols->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, append, sc_list);
// Now check our symbol table for symbols that are code symbols if requested
if (include_symbols)
{
ObjectFile *objfile = GetObjectFile();
if (objfile)
{
Symtab *symtab = objfile->GetSymtab();
if (symtab)
{
std::vector<uint32_t> symbol_indexes;
symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
const uint32_t num_matches = symbol_indexes.size();
if (num_matches)
{
const bool merge_symbol_into_function = true;
SymbolContext sc(this);
for (uint32_t i=0; i<num_matches; i++)
{
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
sc_list.AppendIfUnique (sc, merge_symbol_into_function);
}
}
}
}
}
return sc_list.GetSize() - start_size;
}