本文整理汇总了C++中Symtab::SymbolAtIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ Symtab::SymbolAtIndex方法的具体用法?C++ Symtab::SymbolAtIndex怎么用?C++ Symtab::SymbolAtIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symtab
的用法示例。
在下文中一共展示了Symtab::SymbolAtIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: GetSymbolAtIndex
SBSymbol SBModule::GetSymbolAtIndex(size_t idx) {
SBSymbol sb_symbol;
ModuleSP module_sp(GetSP());
Symtab *symtab = GetUnifiedSymbolTable(module_sp);
if (symtab)
sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx));
return sb_symbol;
}
示例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;
}
示例4: module_sp
SBSymbol
SBModule::GetSymbolAtIndex (size_t idx)
{
SBSymbol sb_symbol;
ModuleSP module_sp (GetSP ());
if (module_sp)
{
ObjectFile *obj_file = module_sp->GetObjectFile();
if (obj_file)
{
Symtab *symtab = obj_file->GetSymtab();
if (symtab)
sb_symbol.SetSymbol(symtab->SymbolAtIndex (idx));
}
}
return sb_symbol;
}