void AddSymbolFileRepresentation(const lldb::ObjectFileSP &objfile_sp);
- virtual void Dump(Stream *s);
-
- virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit);
-
- virtual size_t ParseFunctions(CompileUnit &comp_unit);
-
- virtual bool ParseLineTable(CompileUnit &comp_unit);
-
- virtual bool ParseDebugMacros(CompileUnit &comp_unit);
-
- virtual bool ParseSupportFiles(CompileUnit &comp_unit,
- FileSpecList &support_files);
-
- virtual bool ParseIsOptimized(CompileUnit &comp_unit);
-
- virtual size_t ParseTypes(CompileUnit &comp_unit);
-
- virtual bool
- ParseImportedModules(const SymbolContext &sc,
- std::vector<SourceModule> &imported_modules);
-
- virtual size_t ParseBlocksRecursive(Function &func);
-
- virtual size_t ParseVariablesForContext(const SymbolContext &sc);
-
- virtual Type *ResolveTypeUID(lldb::user_id_t type_uid);
-
- virtual uint32_t ResolveSymbolContext(const Address &so_addr,
- lldb::SymbolContextItem resolve_scope,
- SymbolContext &sc);
-
- virtual uint32_t ResolveSymbolContext(const FileSpec &file_spec,
- uint32_t line, bool check_inlines,
- lldb::SymbolContextItem resolve_scope,
- SymbolContextList &sc_list);
-
- virtual size_t FindGlobalVariables(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- size_t max_matches,
- VariableList &variables);
-
- virtual size_t FindGlobalVariables(const RegularExpression ®ex,
- size_t max_matches,
- VariableList &variables);
-
- virtual size_t FindFunctions(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask,
- bool include_inlines, bool append,
- SymbolContextList &sc_list);
-
- virtual size_t FindFunctions(const RegularExpression ®ex,
- bool include_inlines, bool append,
- SymbolContextList &sc_list);
-
- virtual size_t
- FindTypes(ConstString name, const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
- llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
- TypeMap &types);
-
- virtual size_t FindTypes(const std::vector<CompilerContext> &context,
- bool append, TypeMap &types);
-
- virtual CompilerDeclContext
- FindNamespace(ConstString name,
- const CompilerDeclContext *parent_decl_ctx);
-
- virtual size_t GetNumCompileUnits();
-
- virtual lldb::CompUnitSP GetCompileUnitAtIndex(size_t idx);
-
- virtual size_t GetTypes(SymbolContextScope *sc_scope,
- lldb::TypeClass type_mask, TypeList &type_list);
-
SymbolFile *GetSymbolFile() { return m_sym_file_up.get(); }
- FileSpec GetMainFileSpec() const;
-
- /// Notify the SymbolVendor that the file addresses in the Sections
- /// for this module have been changed.
- virtual void SectionFileAddressesChanged();
-
// PluginInterface protocol
ConstString GetPluginName() override;
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/TypeList.h"
if (!module_sp)
return LLDB_RECORD_RESULT(sb_type_list);
- SymbolVendor *vendor = module_sp->GetSymbolVendor();
- if (!vendor)
+ SymbolFile *symfile = module_sp->GetSymbolFile();
+ if (!symfile)
return LLDB_RECORD_RESULT(sb_type_list);
TypeClass type_class = static_cast<TypeClass>(type_mask);
TypeList type_list;
- vendor->GetTypes(m_opaque_ptr, type_class, type_list);
+ symfile->GetTypes(m_opaque_ptr, type_class, type_list);
sb_type_list.m_opaque_up->Append(type_list);
return LLDB_RECORD_RESULT(sb_type_list);
}
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Symtab.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
ModuleSP module_sp(GetSP());
if (module_sp) {
// Give the symbol vendor a chance to add to the unified section list.
- module_sp->GetSymbolVendor();
+ module_sp->GetSymbolFile();
SectionList *section_list = module_sp->GetSectionList();
if (section_list)
return section_list->GetSize();
ModuleSP module_sp(GetSP());
if (module_sp) {
// Give the symbol vendor a chance to add to the unified section list.
- module_sp->GetSymbolVendor();
+ module_sp->GetSymbolFile();
SectionList *section_list = module_sp->GetSectionList();
if (section_list)
ModuleSP module_sp(GetSP());
if (module_sp) {
- SymbolVendor *vendor = module_sp->GetSymbolVendor();
- if (vendor) {
- Type *type_ptr = vendor->ResolveTypeUID(uid);
+ if (SymbolFile *symfile = module_sp->GetSymbolFile()) {
+ Type *type_ptr = symfile->ResolveTypeUID(uid);
if (type_ptr)
return LLDB_RECORD_RESULT(SBType(type_ptr->shared_from_this()));
}
ModuleSP module_sp(GetSP());
if (!module_sp)
return LLDB_RECORD_RESULT(sb_type_list);
- SymbolVendor *vendor = module_sp->GetSymbolVendor();
- if (!vendor)
+ SymbolFile *symfile = module_sp->GetSymbolFile();
+ if (!symfile)
return LLDB_RECORD_RESULT(sb_type_list);
TypeClass type_class = static_cast<TypeClass>(type_mask);
TypeList type_list;
- vendor->GetTypes(nullptr, type_class, type_list);
+ symfile->GetTypes(nullptr, type_class, type_list);
sb_type_list.m_opaque_up->Append(type_list);
return LLDB_RECORD_RESULT(sb_type_list);
}
ModuleSP module_sp(GetSP());
if (sect_name && module_sp) {
// Give the symbol vendor a chance to add to the unified section list.
- module_sp->GetSymbolVendor();
+ module_sp->GetSymbolFile();
SectionList *section_list = module_sp->GetSectionList();
if (section_list) {
ConstString const_sect_name(sect_name);
lldb::SBFileSpec sb_file_spec;
ModuleSP module_sp(GetSP());
if (module_sp) {
- SymbolVendor *symbol_vendor_ptr = module_sp->GetSymbolVendor();
- if (symbol_vendor_ptr)
- sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec());
+ if (SymbolFile *symfile = module_sp->GetSymbolFile())
+ sb_file_spec.SetFileSpec(symfile->GetObjectFile()->GetFileSpec());
}
return LLDB_RECORD_RESULT(sb_file_spec);
}
#include "lldb/Symbol/LocateSymbolFile.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ABI.h"
}
}
-static bool DumpModuleSymbolVendor(Stream &strm, Module *module) {
+static bool DumpModuleSymbolFile(Stream &strm, Module *module) {
if (module) {
- SymbolVendor *symbol_vendor = module->GetSymbolVendor(true);
- if (symbol_vendor) {
- symbol_vendor->Dump(&strm);
+ if (SymbolFile *symbol_file = module->GetSymbolFile(true)) {
+ symbol_file->Dump(strm);
return true;
}
}
for (uint32_t image_idx = 0; image_idx < num_modules; ++image_idx) {
if (m_interpreter.WasInterrupted())
break;
- if (DumpModuleSymbolVendor(
+ if (DumpModuleSymbolFile(
result.GetOutputStream(),
target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
num_dumped++;
break;
Module *module = module_list.GetModulePointerAtIndex(i);
if (module) {
- if (DumpModuleSymbolVendor(result.GetOutputStream(), module))
+ if (DumpModuleSymbolFile(result.GetOutputStream(), module))
num_dumped++;
}
}
#include "lldb/Core/ModuleList.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/SymbolContext.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Status.h"
// First make sure this compile unit's functions are parsed
// since CompUnit::ForeachFunction only iterates over already
// parsed functions.
- SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
- if (!sym_vendor)
+ SymbolFile *sym_file = module_sp->GetSymbolFile();
+ if (!sym_file)
continue;
- if (!sym_vendor->ParseFunctions(*cu_sp))
+ if (!sym_file->ParseFunctions(*cu_sp))
continue;
// If we got any functions, use ForeachFunction to do the iteration.
cu_sp->ForeachFunction([&](const FunctionSP &func_sp) {
#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/TaggedASTType.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
if (module_sp && namespace_decl) {
CompilerDeclContext found_namespace_decl;
- SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
-
- if (symbol_vendor) {
- found_namespace_decl =
- symbol_vendor->FindNamespace(name, &namespace_decl);
+ if (SymbolFile *symbol_file = module_sp->GetSymbolFile()) {
+ found_namespace_decl = symbol_file->FindNamespace(name, &namespace_decl);
if (found_namespace_decl) {
context.m_namespace_map->push_back(
CompilerDeclContext found_namespace_decl;
- SymbolVendor *symbol_vendor = image->GetSymbolVendor();
+ SymbolFile *symbol_file = image->GetSymbolFile();
- if (!symbol_vendor)
+ if (!symbol_file)
continue;
- found_namespace_decl =
- symbol_vendor->FindNamespace(name, &namespace_decl);
+ found_namespace_decl = symbol_file->FindNamespace(name, &namespace_decl);
if (found_namespace_decl) {
context.m_namespace_map->push_back(
lldb::ModuleSP module_sp = i->first;
CompilerDeclContext module_parent_namespace_decl = i->second;
- SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
+ SymbolFile *symbol_file = module_sp->GetSymbolFile();
- if (!symbol_vendor)
+ if (!symbol_file)
continue;
found_namespace_decl =
- symbol_vendor->FindNamespace(name, &module_parent_namespace_decl);
+ symbol_file->FindNamespace(name, &module_parent_namespace_decl);
if (!found_namespace_decl)
continue;
CompilerDeclContext found_namespace_decl;
- SymbolVendor *symbol_vendor = image->GetSymbolVendor();
+ SymbolFile *symbol_file = image->GetSymbolFile();
- if (!symbol_vendor)
+ if (!symbol_file)
continue;
found_namespace_decl =
- symbol_vendor->FindNamespace(name, &null_namespace_decl);
+ symbol_file->FindNamespace(name, &null_namespace_decl);
if (!found_namespace_decl)
continue;
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeList.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/Target/Language.h"
die.GetDeclContext(decl_context);
TypeMap dwo_types;
- if (!dwo_module_sp->GetSymbolVendor()->FindTypes(decl_context, true,
- dwo_types)) {
+ if (!dwo_module_sp->GetSymbolFile()->FindTypes(decl_context, true,
+ dwo_types)) {
if (!IsClangModuleFwdDecl(die))
return TypeSP();
for (const auto &name_module : sym_file.getExternalTypeModules()) {
if (!name_module.second)
continue;
- SymbolVendor *sym_vendor = name_module.second->GetSymbolVendor();
- if (sym_vendor->FindTypes(decl_context, true, dwo_types))
+ if (name_module.second->GetSymbolFile()->FindTypes(decl_context, true,
+ dwo_types))
break;
}
}
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/LocateSymbolFile.h"
#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
for (const auto &pair : m_external_type_modules) {
ModuleSP external_module_sp = pair.second;
if (external_module_sp) {
- SymbolVendor *sym_vendor = external_module_sp->GetSymbolVendor();
- if (sym_vendor) {
+ SymbolFile *sym_file = external_module_sp->GetSymbolFile();
+ if (sym_file) {
const uint32_t num_external_matches =
- sym_vendor->FindTypes(name, parent_decl_ctx, append, max_matches,
- searched_symbol_files, types);
+ sym_file->FindTypes(name, parent_decl_ctx, append, max_matches,
+ searched_symbol_files, types);
if (num_external_matches)
return num_external_matches;
}
Address oso_so_addr;
if (oso_module->ResolveFileAddress(oso_file_addr, oso_so_addr)) {
resolved_flags |=
- oso_module->GetSymbolVendor()->ResolveSymbolContext(
+ oso_module->GetSymbolFile()->ResolveSymbolContext(
oso_so_addr, resolve_scope, sc);
}
}
if (addr_module == exe_module)
return true; // Address is already in terms of the main executable module
- CompileUnitInfo *cu_info = GetCompileUnitInfo(GetSymbolFileAsSymbolFileDWARF(
- addr_module->GetSymbolVendor()->GetSymbolFile()));
+ CompileUnitInfo *cu_info = GetCompileUnitInfo(
+ GetSymbolFileAsSymbolFileDWARF(addr_module->GetSymbolFile()));
if (cu_info) {
const lldb::addr_t oso_file_addr = addr.GetFileAddress();
const FileRangeMap::Entry *oso_range_entry =
#include "lldb/Core/Section.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Utility/Log.h"
SymbolContext sc;
CalculateSymbolContext(&sc);
assert(sc.module_sp);
- sc.module_sp->GetSymbolVendor()->ParseVariablesForContext(sc);
+ sc.module_sp->GetSymbolFile()->ParseVariablesForContext(sc);
}
}
return m_variable_list_sp;
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Language.h"
if (m_language == eLanguageTypeUnknown) {
if (m_flags.IsClear(flagsParsedLanguage)) {
m_flags.Set(flagsParsedLanguage);
- SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
- if (symbol_vendor) {
- m_language = symbol_vendor->ParseLanguage(*this);
- }
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile())
+ m_language = symfile->ParseLanguage(*this);
}
}
return m_language;
if (m_line_table_up == nullptr) {
if (m_flags.IsClear(flagsParsedLineTable)) {
m_flags.Set(flagsParsedLineTable);
- SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
- if (symbol_vendor)
- symbol_vendor->ParseLineTable(*this);
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile())
+ symfile->ParseLineTable(*this);
}
}
return m_line_table_up.get();
if (m_debug_macros_sp.get() == nullptr) {
if (m_flags.IsClear(flagsParsedDebugMacros)) {
m_flags.Set(flagsParsedDebugMacros);
- SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
- if (symbol_vendor) {
- symbol_vendor->ParseDebugMacros(*this);
- }
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile())
+ symfile->ParseDebugMacros(*this);
}
}
SymbolContext sc;
CalculateSymbolContext(&sc);
assert(sc.module_sp);
- sc.module_sp->GetSymbolVendor()->ParseVariablesForContext(sc);
+ sc.module_sp->GetSymbolFile()->ParseVariablesForContext(sc);
}
return m_variables;
bool CompileUnit::GetIsOptimized() {
if (m_is_optimized == eLazyBoolCalculate) {
m_is_optimized = eLazyBoolNo;
- if (SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor()) {
- if (symbol_vendor->ParseIsOptimized(*this))
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile()) {
+ if (symfile->ParseIsOptimized(*this))
m_is_optimized = eLazyBoolYes;
}
}
if (m_imported_modules.empty() &&
m_flags.IsClear(flagsParsedImportedModules)) {
m_flags.Set(flagsParsedImportedModules);
- if (SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor()) {
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile()) {
SymbolContext sc;
CalculateSymbolContext(&sc);
- symbol_vendor->ParseImportedModules(sc, m_imported_modules);
+ symfile->ParseImportedModules(sc, m_imported_modules);
}
}
return m_imported_modules;
if (m_support_files.GetSize() == 0) {
if (m_flags.IsClear(flagsParsedSupportFiles)) {
m_flags.Set(flagsParsedSupportFiles);
- SymbolVendor *symbol_vendor = GetModule()->GetSymbolVendor();
- if (symbol_vendor) {
- symbol_vendor->ParseSupportFiles(*this, m_support_files);
- }
+ if (SymbolFile *symfile = GetModule()->GetSymbolFile())
+ symfile->ParseSupportFiles(*this, m_support_files);
}
}
return m_support_files;
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolFile.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/Language.h"
#include "lldb/Utility/Log.h"
#include "llvm/Support/Casting.h"
if (!m_block.BlockInfoHasBeenParsed() && can_create) {
ModuleSP module_sp = CalculateSymbolContextModule();
if (module_sp) {
- module_sp->GetSymbolVendor()->ParseBlocksRecursive(*this);
+ module_sp->GetSymbolFile()->ParseBlocksRecursive(*this);
} else {
Host::SystemLog(Host::eSystemLogError,
"error: unable to find module "
}
}
-size_t SymbolVendor::GetNumCompileUnits() {
- if (m_sym_file_up)
- return m_sym_file_up->GetNumCompileUnits();
- return 0;
-}
-
-lldb::LanguageType SymbolVendor::ParseLanguage(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseLanguage(comp_unit);
- return eLanguageTypeUnknown;
-}
-
-size_t SymbolVendor::ParseFunctions(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseFunctions(comp_unit);
- return 0;
-}
-
-bool SymbolVendor::ParseLineTable(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseLineTable(comp_unit);
- return false;
-}
-
-bool SymbolVendor::ParseDebugMacros(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseDebugMacros(comp_unit);
- return false;
-}
-bool SymbolVendor::ParseSupportFiles(CompileUnit &comp_unit,
- FileSpecList &support_files) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseSupportFiles(comp_unit, support_files);
- return false;
-}
-
-bool SymbolVendor::ParseIsOptimized(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseIsOptimized(comp_unit);
- return false;
-}
-
-bool SymbolVendor::ParseImportedModules(
- const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseImportedModules(sc, imported_modules);
- return false;
-}
-
-size_t SymbolVendor::ParseBlocksRecursive(Function &func) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseBlocksRecursive(func);
- return 0;
-}
-
-size_t SymbolVendor::ParseTypes(CompileUnit &comp_unit) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseTypes(comp_unit);
- return 0;
-}
-
-size_t SymbolVendor::ParseVariablesForContext(const SymbolContext &sc) {
- if (m_sym_file_up)
- return m_sym_file_up->ParseVariablesForContext(sc);
- return 0;
-}
-
-Type *SymbolVendor::ResolveTypeUID(lldb::user_id_t type_uid) {
- if (m_sym_file_up)
- return m_sym_file_up->ResolveTypeUID(type_uid);
- return nullptr;
-}
-
-uint32_t SymbolVendor::ResolveSymbolContext(const Address &so_addr,
- SymbolContextItem resolve_scope,
- SymbolContext &sc) {
- if (m_sym_file_up)
- return m_sym_file_up->ResolveSymbolContext(so_addr, resolve_scope, sc);
- return 0;
-}
-
-uint32_t SymbolVendor::ResolveSymbolContext(const FileSpec &file_spec,
- uint32_t line, bool check_inlines,
- SymbolContextItem resolve_scope,
- SymbolContextList &sc_list) {
- if (m_sym_file_up)
- return m_sym_file_up->ResolveSymbolContext(file_spec, line, check_inlines,
- resolve_scope, sc_list);
- return 0;
-}
-
-size_t
-SymbolVendor::FindGlobalVariables(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- size_t max_matches, VariableList &variables) {
- if (m_sym_file_up)
- return m_sym_file_up->FindGlobalVariables(name, parent_decl_ctx,
- max_matches, variables);
- return 0;
-}
-
-size_t SymbolVendor::FindGlobalVariables(const RegularExpression ®ex,
- size_t max_matches,
- VariableList &variables) {
- if (m_sym_file_up)
- return m_sym_file_up->FindGlobalVariables(regex, max_matches, variables);
- return 0;
-}
-
-size_t SymbolVendor::FindFunctions(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) {
- if (m_sym_file_up)
- return m_sym_file_up->FindFunctions(name, parent_decl_ctx, name_type_mask,
- include_inlines, append, sc_list);
- return 0;
-}
-
-size_t SymbolVendor::FindFunctions(const RegularExpression ®ex,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) {
- if (m_sym_file_up)
- return m_sym_file_up->FindFunctions(regex, include_inlines, append,
- sc_list);
- return 0;
-}
-
-size_t SymbolVendor::FindTypes(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
- llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
- TypeMap &types) {
- if (m_sym_file_up)
- return m_sym_file_up->FindTypes(name, parent_decl_ctx, append, max_matches,
- searched_symbol_files, types);
- if (!append)
- types.Clear();
- return 0;
-}
-
-size_t SymbolVendor::FindTypes(const std::vector<CompilerContext> &context,
- bool append, TypeMap &types) {
- if (m_sym_file_up)
- return m_sym_file_up->FindTypes(context, append, types);
- if (!append)
- types.Clear();
- return 0;
-}
-
-size_t SymbolVendor::GetTypes(SymbolContextScope *sc_scope, TypeClass type_mask,
- lldb_private::TypeList &type_list) {
- if (m_sym_file_up)
- return m_sym_file_up->GetTypes(sc_scope, type_mask, type_list);
- return 0;
-}
-
-CompilerDeclContext
-SymbolVendor::FindNamespace(ConstString name,
- const CompilerDeclContext *parent_decl_ctx) {
- CompilerDeclContext namespace_decl_ctx;
- if (m_sym_file_up)
- namespace_decl_ctx = m_sym_file_up->FindNamespace(name, parent_decl_ctx);
- return namespace_decl_ctx;
-}
-
-void SymbolVendor::Dump(Stream *s) {
- ModuleSP module_sp(GetModule());
- if (module_sp) {
- std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
-
- s->Printf("%p: ", static_cast<void *>(this));
- s->Indent();
- s->PutCString("SymbolVendor");
- if (m_sym_file_up) {
- *s << " " << m_sym_file_up->GetPluginName();
- ObjectFile *objfile = m_sym_file_up->GetObjectFile();
- if (objfile) {
- const FileSpec &objfile_file_spec = objfile->GetFileSpec();
- if (objfile_file_spec) {
- s->PutCString(" (");
- objfile_file_spec.Dump(s);
- s->PutChar(')');
- }
- }
- }
- s->EOL();
- if (m_sym_file_up)
- m_sym_file_up->Dump(*s);
- }
-}
-
-CompUnitSP SymbolVendor::GetCompileUnitAtIndex(size_t idx) {
- if (m_sym_file_up)
- return m_sym_file_up->GetCompileUnitAtIndex(idx);
- return nullptr;
-}
-
-FileSpec SymbolVendor::GetMainFileSpec() const {
- if (m_sym_file_up) {
- const ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
- if (symfile_objfile)
- return symfile_objfile->GetFileSpec();
- }
-
- return FileSpec();
-}
-
-void SymbolVendor::SectionFileAddressesChanged() {
- if (m_sym_file_up)
- m_sym_file_up->SectionFileAddressesChanged();
-}
-
// PluginInterface protocol
lldb_private::ConstString SymbolVendor::GetPluginName() {
static ConstString g_name("vendor-default");
#include "lldb/Symbol/ClangASTImporter.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
static cl::opt<int> Line("line", cl::desc("Line to search."),
cl::sub(SymbolsSubcommand));
-static Expected<CompilerDeclContext> getDeclContext(SymbolVendor &Vendor);
+static Expected<CompilerDeclContext> getDeclContext(SymbolFile &Symfile);
static Error findFunctions(lldb_private::Module &Module);
static Error findBlocks(lldb_private::Module &Module);
}
Expected<CompilerDeclContext>
-opts::symbols::getDeclContext(SymbolVendor &Vendor) {
+opts::symbols::getDeclContext(SymbolFile &Symfile) {
if (Context.empty())
return CompilerDeclContext();
VariableList List;
- Vendor.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
if (List.Empty())
return make_string_error("Context search didn't find a match.");
if (List.GetSize() > 1)
}
Error opts::symbols::findFunctions(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ SymbolFile &Symfile = *Module.GetSymbolFile();
SymbolContextList List;
if (!File.empty()) {
assert(Line != 0);
} else if (Regex) {
RegularExpression RE(Name);
assert(RE.IsValid());
- Vendor.FindFunctions(RE, true, false, List);
+ Symfile.FindFunctions(RE, true, false, List);
} else {
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
- Vendor.FindFunctions(ConstString(Name), ContextPtr, getFunctionNameFlags(),
+ Symfile.FindFunctions(ConstString(Name), ContextPtr, getFunctionNameFlags(),
true, false, List);
}
outs() << formatv("Found {0} functions:\n", List.GetSize());
}
Error opts::symbols::findNamespaces(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ SymbolFile &Symfile = *Module.GetSymbolFile();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
CompilerDeclContext Result =
- Vendor.FindNamespace(ConstString(Name), ContextPtr);
+ Symfile.FindNamespace(ConstString(Name), ContextPtr);
if (Result)
outs() << "Found namespace: "
<< Result.GetScopeQualifiedName().GetStringRef() << "\n";
}
Error opts::symbols::findTypes(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ SymbolFile &Symfile = *Module.GetSymbolFile();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
DenseSet<SymbolFile *> SearchedFiles;
TypeMap Map;
- Vendor.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
+ Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
SearchedFiles, Map);
outs() << formatv("Found {0} types:\n", Map.GetSize());
}
Error opts::symbols::findVariables(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ SymbolFile &Symfile = *Module.GetSymbolFile();
VariableList List;
if (Regex) {
RegularExpression RE(Name);
assert(RE.IsValid());
- Vendor.FindGlobalVariables(RE, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(RE, UINT32_MAX, List);
} else if (!File.empty()) {
CompUnitSP CU;
for (size_t Ind = 0; !CU && Ind < Module.GetNumCompileUnits(); ++Ind) {
List.AddVariables(CU->GetVariableList(true).get());
} else {
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
- Vendor.FindGlobalVariables(ConstString(Name), ContextPtr, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(ConstString(Name), ContextPtr, UINT32_MAX, List);
}
outs() << formatv("Found {0} variables:\n", List.GetSize());
StreamString Stream;
}
Error opts::symbols::dumpAST(lldb_private::Module &Module) {
- SymbolVendor &plugin = *Module.GetSymbolVendor();
- Module.ParseAllDebugSymbols();
+ Module.ParseAllDebugSymbols();
- auto symfile = plugin.GetSymbolFile();
+ auto symfile = Module.GetSymbolFile();
if (!symfile)
return make_string_error("Module has no symbol file.");
}
Error opts::symbols::verify(lldb_private::Module &Module) {
- SymbolVendor &plugin = *Module.GetSymbolVendor();
-
- SymbolFile *symfile = plugin.GetSymbolFile();
+ SymbolFile *symfile = Module.GetSymbolFile();
if (!symfile)
return make_string_error("Module has no symbol file.");
Spec.GetSymbolFileSpec().SetFile(Symbols, FileSpec::Style::native);
auto ModulePtr = std::make_shared<lldb_private::Module>(Spec);
- SymbolVendor *Vendor = ModulePtr->GetSymbolVendor();
- if (!Vendor) {
+ SymbolFile *Symfile = ModulePtr->GetSymbolFile();
+ if (!Symfile) {
WithColor::error() << "Module has no symbol vendor.\n";
return 1;
}
// Fetch symbol vendor before we get the section list to give the symbol
// vendor a chance to populate it.
- ModulePtr->GetSymbolVendor();
+ ModulePtr->GetSymbolFile();
SectionList *Sections = ModulePtr->GetSectionList();
if (!Sections) {
llvm::errs() << "Could not load sections for module " << File << "\n";
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/FileSpec.h"
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
- SymbolVendor *plugin = module->GetSymbolVendor();
- EXPECT_NE(nullptr, plugin);
- SymbolFile *symfile = plugin->GetSymbolFile();
- EXPECT_NE(nullptr, symfile);
+ SymbolFile *symfile = module->GetSymbolFile();
+ ASSERT_NE(nullptr, symfile);
EXPECT_EQ(symfile->GetPluginName(), SymbolFileDWARF::GetPluginNameStatic());
uint32_t expected_abilities = SymbolFile::kAllAbilities;