10b57cec5SDimitry Andric //===-- SymbolFile.h --------------------------------------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 95ffd83dbSDimitry Andric #ifndef LLDB_SYMBOL_SYMBOLFILE_H 105ffd83dbSDimitry Andric #define LLDB_SYMBOL_SYMBOLFILE_H 110b57cec5SDimitry Andric 120b57cec5SDimitry Andric #include "lldb/Core/PluginInterface.h" 13fe6060f1SDimitry Andric #include "lldb/Core/SourceLocationSpec.h" 140b57cec5SDimitry Andric #include "lldb/Symbol/CompilerDecl.h" 150b57cec5SDimitry Andric #include "lldb/Symbol/CompilerDeclContext.h" 160b57cec5SDimitry Andric #include "lldb/Symbol/CompilerType.h" 170b57cec5SDimitry Andric #include "lldb/Symbol/Function.h" 180b57cec5SDimitry Andric #include "lldb/Symbol/SourceModule.h" 190b57cec5SDimitry Andric #include "lldb/Symbol/Type.h" 209dba64beSDimitry Andric #include "lldb/Symbol/TypeList.h" 219dba64beSDimitry Andric #include "lldb/Symbol/TypeSystem.h" 22*349cc55cSDimitry Andric #include "lldb/Target/Statistics.h" 235ffd83dbSDimitry Andric #include "lldb/Utility/XcodeSDK.h" 240b57cec5SDimitry Andric #include "lldb/lldb-private.h" 250b57cec5SDimitry Andric #include "llvm/ADT/DenseSet.h" 269dba64beSDimitry Andric #include "llvm/Support/Errc.h" 270b57cec5SDimitry Andric 280b57cec5SDimitry Andric #include <mutex> 290b57cec5SDimitry Andric 300b57cec5SDimitry Andric #if defined(LLDB_CONFIGURATION_DEBUG) 310b57cec5SDimitry Andric #define ASSERT_MODULE_LOCK(expr) (expr->AssertModuleLock()) 320b57cec5SDimitry Andric #else 330b57cec5SDimitry Andric #define ASSERT_MODULE_LOCK(expr) ((void)0) 340b57cec5SDimitry Andric #endif 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric namespace lldb_private { 370b57cec5SDimitry Andric 380b57cec5SDimitry Andric class SymbolFile : public PluginInterface { 39480093f4SDimitry Andric /// LLVM RTTI support. 40480093f4SDimitry Andric static char ID; 41480093f4SDimitry Andric 420b57cec5SDimitry Andric public: 43480093f4SDimitry Andric /// LLVM RTTI support. 44480093f4SDimitry Andric /// \{ 45480093f4SDimitry Andric virtual bool isA(const void *ClassID) const { return ClassID == &ID; } 46480093f4SDimitry Andric static bool classof(const SymbolFile *obj) { return obj->isA(&ID); } 47480093f4SDimitry Andric /// \} 48480093f4SDimitry Andric 490b57cec5SDimitry Andric // Symbol file ability bits. 500b57cec5SDimitry Andric // 510b57cec5SDimitry Andric // Each symbol file can claim to support one or more symbol file abilities. 520b57cec5SDimitry Andric // These get returned from SymbolFile::GetAbilities(). These help us to 530b57cec5SDimitry Andric // determine which plug-in will be best to load the debug information found 540b57cec5SDimitry Andric // in files. 550b57cec5SDimitry Andric enum Abilities { 560b57cec5SDimitry Andric CompileUnits = (1u << 0), 570b57cec5SDimitry Andric LineTables = (1u << 1), 580b57cec5SDimitry Andric Functions = (1u << 2), 590b57cec5SDimitry Andric Blocks = (1u << 3), 600b57cec5SDimitry Andric GlobalVariables = (1u << 4), 610b57cec5SDimitry Andric LocalVariables = (1u << 5), 620b57cec5SDimitry Andric VariableTypes = (1u << 6), 630b57cec5SDimitry Andric kAllAbilities = ((1u << 7) - 1u) 640b57cec5SDimitry Andric }; 650b57cec5SDimitry Andric 669dba64beSDimitry Andric static SymbolFile *FindPlugin(lldb::ObjectFileSP objfile_sp); 670b57cec5SDimitry Andric 680b57cec5SDimitry Andric // Constructors and Destructors 699dba64beSDimitry Andric SymbolFile(lldb::ObjectFileSP objfile_sp) 709dba64beSDimitry Andric : m_objfile_sp(std::move(objfile_sp)), m_abilities(0), 719dba64beSDimitry Andric m_calculated_abilities(false) {} 720b57cec5SDimitry Andric 73fe6060f1SDimitry Andric ~SymbolFile() override = default; 740b57cec5SDimitry Andric 750b57cec5SDimitry Andric /// Get a mask of what this symbol file supports for the object file 760b57cec5SDimitry Andric /// that it was constructed with. 770b57cec5SDimitry Andric /// 780b57cec5SDimitry Andric /// Each symbol file gets to respond with a mask of abilities that 790b57cec5SDimitry Andric /// it supports for each object file. This happens when we are 800b57cec5SDimitry Andric /// trying to figure out which symbol file plug-in will get used 810b57cec5SDimitry Andric /// for a given object file. The plug-in that responds with the 820b57cec5SDimitry Andric /// best mix of "SymbolFile::Abilities" bits set, will get chosen to 830b57cec5SDimitry Andric /// be the symbol file parser. This allows each plug-in to check for 840b57cec5SDimitry Andric /// sections that contain data a symbol file plug-in would need. For 850b57cec5SDimitry Andric /// example the DWARF plug-in requires DWARF sections in a file that 860b57cec5SDimitry Andric /// contain debug information. If the DWARF plug-in doesn't find 870b57cec5SDimitry Andric /// these sections, it won't respond with many ability bits set, and 880b57cec5SDimitry Andric /// we will probably fall back to the symbol table SymbolFile plug-in 890b57cec5SDimitry Andric /// which uses any information in the symbol table. Also, plug-ins 900b57cec5SDimitry Andric /// might check for some specific symbols in a symbol table in the 910b57cec5SDimitry Andric /// case where the symbol table contains debug information (STABS 920b57cec5SDimitry Andric /// and COFF). Not a lot of work should happen in these functions 930b57cec5SDimitry Andric /// as the plug-in might not get selected due to another plug-in 940b57cec5SDimitry Andric /// having more abilities. Any initialization work should be saved 950b57cec5SDimitry Andric /// for "void SymbolFile::InitializeObject()" which will get called 960b57cec5SDimitry Andric /// on the SymbolFile object with the best set of abilities. 970b57cec5SDimitry Andric /// 980b57cec5SDimitry Andric /// \return 990b57cec5SDimitry Andric /// A uint32_t mask containing bits from the SymbolFile::Abilities 1000b57cec5SDimitry Andric /// enumeration. Any bits that are set represent an ability that 1010b57cec5SDimitry Andric /// this symbol plug-in can parse from the object file. 1020b57cec5SDimitry Andric uint32_t GetAbilities() { 1030b57cec5SDimitry Andric if (!m_calculated_abilities) { 1040b57cec5SDimitry Andric m_abilities = CalculateAbilities(); 1050b57cec5SDimitry Andric m_calculated_abilities = true; 1060b57cec5SDimitry Andric } 1070b57cec5SDimitry Andric 1080b57cec5SDimitry Andric return m_abilities; 1090b57cec5SDimitry Andric } 1100b57cec5SDimitry Andric 1110b57cec5SDimitry Andric virtual uint32_t CalculateAbilities() = 0; 1120b57cec5SDimitry Andric 1130b57cec5SDimitry Andric /// Symbols file subclasses should override this to return the Module that 1140b57cec5SDimitry Andric /// owns the TypeSystem that this symbol file modifies type information in. 1150b57cec5SDimitry Andric virtual std::recursive_mutex &GetModuleMutex() const; 1160b57cec5SDimitry Andric 1170b57cec5SDimitry Andric /// Initialize the SymbolFile object. 1180b57cec5SDimitry Andric /// 1190b57cec5SDimitry Andric /// The SymbolFile object with the best set of abilities (detected 1200b57cec5SDimitry Andric /// in "uint32_t SymbolFile::GetAbilities()) will have this function 1210b57cec5SDimitry Andric /// called if it is chosen to parse an object file. More complete 1220b57cec5SDimitry Andric /// initialization can happen in this function which will get called 1230b57cec5SDimitry Andric /// prior to any other functions in the SymbolFile protocol. 1240b57cec5SDimitry Andric virtual void InitializeObject() {} 1250b57cec5SDimitry Andric 1260b57cec5SDimitry Andric // Compile Unit function calls 1270b57cec5SDimitry Andric // Approach 1 - iterator 1289dba64beSDimitry Andric uint32_t GetNumCompileUnits(); 1299dba64beSDimitry Andric lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx); 1309dba64beSDimitry Andric 1319dba64beSDimitry Andric Symtab *GetSymtab(); 1320b57cec5SDimitry Andric 1330b57cec5SDimitry Andric virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) = 0; 1345ffd83dbSDimitry Andric /// Return the Xcode SDK comp_unit was compiled against. 1355ffd83dbSDimitry Andric virtual XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) { return {}; } 1360b57cec5SDimitry Andric virtual size_t ParseFunctions(CompileUnit &comp_unit) = 0; 1370b57cec5SDimitry Andric virtual bool ParseLineTable(CompileUnit &comp_unit) = 0; 1380b57cec5SDimitry Andric virtual bool ParseDebugMacros(CompileUnit &comp_unit) = 0; 139480093f4SDimitry Andric 140480093f4SDimitry Andric /// Apply a lambda to each external lldb::Module referenced by this 141480093f4SDimitry Andric /// \p comp_unit. Recursively also descends into the referenced external 142480093f4SDimitry Andric /// modules of any encountered compilation unit. 143480093f4SDimitry Andric /// 1445ffd83dbSDimitry Andric /// This function can be used to traverse Clang -gmodules debug 1455ffd83dbSDimitry Andric /// information, which is stored in DWARF files separate from the 1465ffd83dbSDimitry Andric /// object files. 1475ffd83dbSDimitry Andric /// 148480093f4SDimitry Andric /// \param comp_unit 149480093f4SDimitry Andric /// When this SymbolFile consists of multiple auxilliary 150480093f4SDimitry Andric /// SymbolFiles, for example, a Darwin debug map that references 151480093f4SDimitry Andric /// multiple .o files, comp_unit helps choose the auxilliary 152480093f4SDimitry Andric /// file. In most other cases comp_unit's symbol file is 1535ffd83dbSDimitry Andric /// identical with *this. 154480093f4SDimitry Andric /// 155480093f4SDimitry Andric /// \param[in] lambda 156480093f4SDimitry Andric /// The lambda that should be applied to every function. The lambda can 157480093f4SDimitry Andric /// return true if the iteration should be aborted earlier. 158480093f4SDimitry Andric /// 159480093f4SDimitry Andric /// \param visited_symbol_files 160480093f4SDimitry Andric /// A set of SymbolFiles that were already visited to avoid 161480093f4SDimitry Andric /// visiting one file more than once. 162480093f4SDimitry Andric /// 163480093f4SDimitry Andric /// \return 164480093f4SDimitry Andric /// If the lambda early-exited, this function returns true to 165480093f4SDimitry Andric /// propagate the early exit. 166480093f4SDimitry Andric virtual bool ForEachExternalModule( 167480093f4SDimitry Andric lldb_private::CompileUnit &comp_unit, 168480093f4SDimitry Andric llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files, 169480093f4SDimitry Andric llvm::function_ref<bool(Module &)> lambda) { 170480093f4SDimitry Andric return false; 171480093f4SDimitry Andric } 1720b57cec5SDimitry Andric virtual bool ParseSupportFiles(CompileUnit &comp_unit, 1730b57cec5SDimitry Andric FileSpecList &support_files) = 0; 1740b57cec5SDimitry Andric virtual size_t ParseTypes(CompileUnit &comp_unit) = 0; 1750b57cec5SDimitry Andric virtual bool ParseIsOptimized(CompileUnit &comp_unit) { return false; } 1760b57cec5SDimitry Andric 1770b57cec5SDimitry Andric virtual bool 1780b57cec5SDimitry Andric ParseImportedModules(const SymbolContext &sc, 1790b57cec5SDimitry Andric std::vector<SourceModule> &imported_modules) = 0; 1800b57cec5SDimitry Andric virtual size_t ParseBlocksRecursive(Function &func) = 0; 1810b57cec5SDimitry Andric virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0; 1820b57cec5SDimitry Andric virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0; 1830b57cec5SDimitry Andric 1840b57cec5SDimitry Andric 1850b57cec5SDimitry Andric /// The characteristics of an array type. 1860b57cec5SDimitry Andric struct ArrayInfo { 1870b57cec5SDimitry Andric int64_t first_index = 0; 1880b57cec5SDimitry Andric llvm::SmallVector<uint64_t, 1> element_orders; 1890b57cec5SDimitry Andric uint32_t byte_stride = 0; 1900b57cec5SDimitry Andric uint32_t bit_stride = 0; 1910b57cec5SDimitry Andric }; 1920b57cec5SDimitry Andric /// If \c type_uid points to an array type, return its characteristics. 1930b57cec5SDimitry Andric /// To support variable-length array types, this function takes an 1945ffd83dbSDimitry Andric /// optional \p ExecutionContext. If \c exe_ctx is non-null, the 1950b57cec5SDimitry Andric /// dynamic characteristics for that context are returned. 1960b57cec5SDimitry Andric virtual llvm::Optional<ArrayInfo> 1970b57cec5SDimitry Andric GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, 1980b57cec5SDimitry Andric const lldb_private::ExecutionContext *exe_ctx) = 0; 1990b57cec5SDimitry Andric 2000b57cec5SDimitry Andric virtual bool CompleteType(CompilerType &compiler_type) = 0; 2010b57cec5SDimitry Andric virtual void ParseDeclsForContext(CompilerDeclContext decl_ctx) {} 2020b57cec5SDimitry Andric virtual CompilerDecl GetDeclForUID(lldb::user_id_t uid) { 2030b57cec5SDimitry Andric return CompilerDecl(); 2040b57cec5SDimitry Andric } 2050b57cec5SDimitry Andric virtual CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) { 2060b57cec5SDimitry Andric return CompilerDeclContext(); 2070b57cec5SDimitry Andric } 2080b57cec5SDimitry Andric virtual CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) { 2090b57cec5SDimitry Andric return CompilerDeclContext(); 2100b57cec5SDimitry Andric } 2110b57cec5SDimitry Andric virtual uint32_t ResolveSymbolContext(const Address &so_addr, 2120b57cec5SDimitry Andric lldb::SymbolContextItem resolve_scope, 2130b57cec5SDimitry Andric SymbolContext &sc) = 0; 214fe6060f1SDimitry Andric virtual uint32_t 215fe6060f1SDimitry Andric ResolveSymbolContext(const SourceLocationSpec &src_location_spec, 2160b57cec5SDimitry Andric lldb::SymbolContextItem resolve_scope, 2170b57cec5SDimitry Andric SymbolContextList &sc_list); 2180b57cec5SDimitry Andric 2190b57cec5SDimitry Andric virtual void DumpClangAST(Stream &s) {} 2205ffd83dbSDimitry Andric virtual void FindGlobalVariables(ConstString name, 2215ffd83dbSDimitry Andric const CompilerDeclContext &parent_decl_ctx, 2225ffd83dbSDimitry Andric uint32_t max_matches, 2235ffd83dbSDimitry Andric VariableList &variables); 2249dba64beSDimitry Andric virtual void FindGlobalVariables(const RegularExpression ®ex, 2250b57cec5SDimitry Andric uint32_t max_matches, 2260b57cec5SDimitry Andric VariableList &variables); 2279dba64beSDimitry Andric virtual void FindFunctions(ConstString name, 2285ffd83dbSDimitry Andric const CompilerDeclContext &parent_decl_ctx, 2290b57cec5SDimitry Andric lldb::FunctionNameType name_type_mask, 2309dba64beSDimitry Andric bool include_inlines, SymbolContextList &sc_list); 2319dba64beSDimitry Andric virtual void FindFunctions(const RegularExpression ®ex, 2329dba64beSDimitry Andric bool include_inlines, SymbolContextList &sc_list); 2339dba64beSDimitry Andric virtual void 2345ffd83dbSDimitry Andric FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx, 2359dba64beSDimitry Andric uint32_t max_matches, 2360b57cec5SDimitry Andric llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, 2370b57cec5SDimitry Andric TypeMap &types); 2389dba64beSDimitry Andric 2399dba64beSDimitry Andric /// Find types specified by a CompilerContextPattern. 240480093f4SDimitry Andric /// \param languages 241480093f4SDimitry Andric /// Only return results in these languages. 242480093f4SDimitry Andric /// \param searched_symbol_files 243480093f4SDimitry Andric /// Prevents one file from being visited multiple times. 244480093f4SDimitry Andric virtual void 245480093f4SDimitry Andric FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages, 246480093f4SDimitry Andric llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, 247480093f4SDimitry Andric TypeMap &types); 2480b57cec5SDimitry Andric 2490b57cec5SDimitry Andric virtual void 2500b57cec5SDimitry Andric GetMangledNamesForFunction(const std::string &scope_qualified_name, 2510b57cec5SDimitry Andric std::vector<ConstString> &mangled_names); 2529dba64beSDimitry Andric 2539dba64beSDimitry Andric virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope, 2540b57cec5SDimitry Andric lldb::TypeClass type_mask, 2550b57cec5SDimitry Andric lldb_private::TypeList &type_list) = 0; 2560b57cec5SDimitry Andric 2570b57cec5SDimitry Andric virtual void PreloadSymbols(); 2580b57cec5SDimitry Andric 2599dba64beSDimitry Andric virtual llvm::Expected<lldb_private::TypeSystem &> 2600b57cec5SDimitry Andric GetTypeSystemForLanguage(lldb::LanguageType language); 2610b57cec5SDimitry Andric 2620b57cec5SDimitry Andric virtual CompilerDeclContext 2635ffd83dbSDimitry Andric FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx) { 2640b57cec5SDimitry Andric return CompilerDeclContext(); 2650b57cec5SDimitry Andric } 2660b57cec5SDimitry Andric 2679dba64beSDimitry Andric ObjectFile *GetObjectFile() { return m_objfile_sp.get(); } 2689dba64beSDimitry Andric const ObjectFile *GetObjectFile() const { return m_objfile_sp.get(); } 2699dba64beSDimitry Andric ObjectFile *GetMainObjectFile(); 2700b57cec5SDimitry Andric 271480093f4SDimitry Andric virtual std::vector<std::unique_ptr<CallEdge>> 272480093f4SDimitry Andric ParseCallEdgesInFunction(UserID func_id) { 2730b57cec5SDimitry Andric return {}; 2740b57cec5SDimitry Andric } 2750b57cec5SDimitry Andric 2760b57cec5SDimitry Andric virtual void AddSymbols(Symtab &symtab) {} 2770b57cec5SDimitry Andric 2780b57cec5SDimitry Andric /// Notify the SymbolFile that the file addresses in the Sections 2790b57cec5SDimitry Andric /// for this module have been changed. 2809dba64beSDimitry Andric virtual void SectionFileAddressesChanged(); 2810b57cec5SDimitry Andric 2820b57cec5SDimitry Andric struct RegisterInfoResolver { 2830b57cec5SDimitry Andric virtual ~RegisterInfoResolver(); // anchor 2840b57cec5SDimitry Andric 2850b57cec5SDimitry Andric virtual const RegisterInfo *ResolveName(llvm::StringRef name) const = 0; 2860b57cec5SDimitry Andric virtual const RegisterInfo *ResolveNumber(lldb::RegisterKind kind, 2870b57cec5SDimitry Andric uint32_t number) const = 0; 2880b57cec5SDimitry Andric }; 2890b57cec5SDimitry Andric virtual lldb::UnwindPlanSP 2900b57cec5SDimitry Andric GetUnwindPlan(const Address &address, const RegisterInfoResolver &resolver) { 2910b57cec5SDimitry Andric return nullptr; 2920b57cec5SDimitry Andric } 2930b57cec5SDimitry Andric 2949dba64beSDimitry Andric /// Return the number of stack bytes taken up by the parameters to this 2959dba64beSDimitry Andric /// function. 2969dba64beSDimitry Andric virtual llvm::Expected<lldb::addr_t> GetParameterStackSize(Symbol &symbol) { 2979dba64beSDimitry Andric return llvm::createStringError(make_error_code(llvm::errc::not_supported), 2989dba64beSDimitry Andric "Operation not supported."); 2999dba64beSDimitry Andric } 3009dba64beSDimitry Andric 3019dba64beSDimitry Andric virtual void Dump(Stream &s); 3020b57cec5SDimitry Andric 303*349cc55cSDimitry Andric /// Metrics gathering functions 304*349cc55cSDimitry Andric 305*349cc55cSDimitry Andric /// Return the size in bytes of all debug information in the symbol file. 306*349cc55cSDimitry Andric /// 307*349cc55cSDimitry Andric /// If the debug information is contained in sections of an ObjectFile, then 308*349cc55cSDimitry Andric /// this call should add the size of all sections that contain debug 309*349cc55cSDimitry Andric /// information. Symbols the symbol tables are not considered debug 310*349cc55cSDimitry Andric /// information for this call to make it easy and quick for this number to be 311*349cc55cSDimitry Andric /// calculated. If the symbol file is all debug information, the size of the 312*349cc55cSDimitry Andric /// entire file should be returned. The default implementation of this 313*349cc55cSDimitry Andric /// function will iterate over all sections in a module and add up their 314*349cc55cSDimitry Andric /// debug info only section byte sizes. 315*349cc55cSDimitry Andric virtual uint64_t GetDebugInfoSize(); 316*349cc55cSDimitry Andric 317*349cc55cSDimitry Andric /// Return the time taken to parse the debug information. 318*349cc55cSDimitry Andric /// 319*349cc55cSDimitry Andric /// \returns 0.0 if no information has been parsed or if there is 320*349cc55cSDimitry Andric /// no computational cost to parsing the debug information. 321*349cc55cSDimitry Andric virtual StatsDuration GetDebugInfoParseTime() { 322*349cc55cSDimitry Andric return StatsDuration(0.0); 323*349cc55cSDimitry Andric } 324*349cc55cSDimitry Andric 325*349cc55cSDimitry Andric /// Return the time it took to index the debug information in the object 326*349cc55cSDimitry Andric /// file. 327*349cc55cSDimitry Andric /// 328*349cc55cSDimitry Andric /// \returns 0.0 if the file doesn't need to be indexed or if it 329*349cc55cSDimitry Andric /// hasn't been indexed yet, or a valid duration if it has. 330*349cc55cSDimitry Andric virtual StatsDuration GetDebugInfoIndexTime() { 331*349cc55cSDimitry Andric return StatsDuration(0.0); 332*349cc55cSDimitry Andric } 333*349cc55cSDimitry Andric 334*349cc55cSDimitry Andric 3350b57cec5SDimitry Andric protected: 3360b57cec5SDimitry Andric void AssertModuleLock(); 3379dba64beSDimitry Andric virtual uint32_t CalculateNumCompileUnits() = 0; 3389dba64beSDimitry Andric virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx) = 0; 3399dba64beSDimitry Andric virtual TypeList &GetTypeList() { return m_type_list; } 3400b57cec5SDimitry Andric 3419dba64beSDimitry Andric void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp); 3429dba64beSDimitry Andric 3439dba64beSDimitry Andric lldb::ObjectFileSP m_objfile_sp; // Keep a reference to the object file in 3449dba64beSDimitry Andric // case it isn't the same as the module 3459dba64beSDimitry Andric // object file (debug symbols in a separate 3469dba64beSDimitry Andric // file) 3479dba64beSDimitry Andric llvm::Optional<std::vector<lldb::CompUnitSP>> m_compile_units; 3489dba64beSDimitry Andric TypeList m_type_list; 3499dba64beSDimitry Andric Symtab *m_symtab = nullptr; 3500b57cec5SDimitry Andric uint32_t m_abilities; 3510b57cec5SDimitry Andric bool m_calculated_abilities; 3520b57cec5SDimitry Andric 3530b57cec5SDimitry Andric private: 3545ffd83dbSDimitry Andric SymbolFile(const SymbolFile &) = delete; 3555ffd83dbSDimitry Andric const SymbolFile &operator=(const SymbolFile &) = delete; 3560b57cec5SDimitry Andric }; 3570b57cec5SDimitry Andric 3580b57cec5SDimitry Andric } // namespace lldb_private 3590b57cec5SDimitry Andric 3605ffd83dbSDimitry Andric #endif // LLDB_SYMBOL_SYMBOLFILE_H 361