本文整理汇总了C++中SymbolContextList::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolContextList::Append方法的具体用法?C++ SymbolContextList::Append怎么用?C++ SymbolContextList::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolContextList
的用法示例。
在下文中一共展示了SymbolContextList::Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalculateSymbolContext
void
Module::SymbolIndicesToSymbolContextList (Symtab *symtab, std::vector<uint32_t> &symbol_indexes, SymbolContextList &sc_list)
{
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
size_t num_indices = symbol_indexes.size();
if (num_indices > 0)
{
SymbolContext sc;
CalculateSymbolContext (&sc);
for (size_t i = 0; i < num_indices; i++)
{
sc.symbol = symtab->SymbolAtIndex (symbol_indexes[i]);
if (sc.symbol)
sc_list.Append (sc);
}
}
}
示例2: GetNumCompileUnits
uint32_t
Module::FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list)
{
if (!append)
sc_list.Clear();
const uint32_t start_size = sc_list.GetSize();
const uint32_t num_compile_units = GetNumCompileUnits();
SymbolContext sc;
sc.module_sp = this;
const bool compare_directory = path.GetDirectory();
for (uint32_t i=0; i<num_compile_units; ++i)
{
sc.comp_unit = GetCompileUnitAtIndex(i).get();
if (FileSpec::Equal (*sc.comp_unit, path, compare_directory))
sc_list.Append(sc);
}
return sc_list.GetSize() - start_size;
}
示例3: sc
uint32_t
CompileUnit::ResolveSymbolContext
(
const FileSpec& file_spec,
uint32_t line,
bool check_inlines,
bool exact,
uint32_t resolve_scope,
SymbolContextList &sc_list
)
{
// First find all of the file indexes that match our "file_spec". If
// "file_spec" has an empty directory, then only compare the basenames
// when finding file indexes
std::vector<uint32_t> file_indexes;
bool file_spec_matches_cu_file_spec = FileSpec::Equal(file_spec, *this, !file_spec.GetDirectory().IsEmpty());
// If we are not looking for inlined functions and our file spec doesn't
// match then we are done...
if (file_spec_matches_cu_file_spec == false && check_inlines == false)
return 0;
uint32_t file_idx = GetSupportFiles().FindFileIndex (1, file_spec, true);
while (file_idx != UINT32_MAX)
{
file_indexes.push_back (file_idx);
file_idx = GetSupportFiles().FindFileIndex (file_idx + 1, file_spec, true);
}
const size_t num_file_indexes = file_indexes.size();
if (num_file_indexes == 0)
return 0;
const uint32_t prev_size = sc_list.GetSize();
SymbolContext sc(GetModule());
sc.comp_unit = this;
if (line != 0)
{
LineTable *line_table = sc.comp_unit->GetLineTable();
if (line_table != NULL)
{
uint32_t found_line;
uint32_t line_idx;
if (num_file_indexes == 1)
{
// We only have a single support file that matches, so use
// the line table function that searches for a line entries
// that match a single support file index
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes.front(), line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
// If they only asked for the line entry, then we're done, we can just copy that over.
// But if they wanted more than just the line number, fill it in.
if (resolve_scope == eSymbolContextLineEntry)
{
sc.line_entry = line_entry;
}
else
{
line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);
}
sc_list.Append(sc);
line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes.front(), found_line, true, &line_entry);
}
}
else
{
// We found multiple support files that match "file_spec" so use
// the line table function that searches for a line entries
// that match a multiple support file indexes.
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes, line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
if (resolve_scope == eSymbolContextLineEntry)
{
sc.line_entry = line_entry;
}
else
//.........这里部分代码省略.........