| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 1 | //===-- SymbolFilePDB.h -------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_ |
| 11 | #define lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_ |
| 12 | |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 13 | #include "lldb/Core/UniqueCStringMap.h" |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 14 | #include "lldb/Symbol/SymbolFile.h" |
| Aaron Smith | cab0d23 | 2018-05-23 01:52:42 +0000 | [diff] [blame] | 15 | #include "lldb/Symbol/VariableList.h" |
| Zachary Turner | fb1a0a0 | 2017-03-06 18:34:25 +0000 | [diff] [blame] | 16 | #include "lldb/Utility/UserID.h" |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 17 | |
| Zachary Turner | 42dff79 | 2016-04-15 00:21:26 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/DenseMap.h" |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 19 | #include "llvm/DebugInfo/PDB/IPDBSession.h" |
| 20 | #include "llvm/DebugInfo/PDB/PDB.h" |
| Aaron Smith | 10a0257 | 2018-01-13 06:58:18 +0000 | [diff] [blame] | 21 | #include "llvm/DebugInfo/PDB/PDBSymbolExe.h" |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 22 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 23 | class SymbolFilePDB : public lldb_private::SymbolFile { |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 24 | public: |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 25 | //------------------------------------------------------------------ |
| 26 | // Static Functions |
| 27 | //------------------------------------------------------------------ |
| 28 | static void Initialize(); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 29 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 30 | static void Terminate(); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 31 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 32 | static void DebuggerInitialize(lldb_private::Debugger &debugger); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 33 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 34 | static lldb_private::ConstString GetPluginNameStatic(); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 35 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 36 | static const char *GetPluginDescriptionStatic(); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 37 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 38 | static lldb_private::SymbolFile * |
| 39 | CreateInstance(lldb_private::ObjectFile *obj_file); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 40 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 41 | //------------------------------------------------------------------ |
| 42 | // Constructors and Destructors |
| 43 | //------------------------------------------------------------------ |
| 44 | SymbolFilePDB(lldb_private::ObjectFile *ofile); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 45 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 46 | ~SymbolFilePDB() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 47 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 48 | uint32_t CalculateAbilities() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 49 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 50 | void InitializeObject() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 51 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 52 | //------------------------------------------------------------------ |
| 53 | // Compile Unit function calls |
| 54 | //------------------------------------------------------------------ |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 55 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 56 | uint32_t GetNumCompileUnits() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 57 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 58 | lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 59 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 60 | lldb::LanguageType |
| 61 | ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 62 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 63 | size_t |
| 64 | ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 65 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 66 | bool |
| 67 | ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 68 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 69 | bool |
| 70 | ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 71 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 72 | bool ParseCompileUnitSupportFiles( |
| 73 | const lldb_private::SymbolContext &sc, |
| 74 | lldb_private::FileSpecList &support_files) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 75 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 76 | bool ParseImportedModules( |
| 77 | const lldb_private::SymbolContext &sc, |
| 78 | std::vector<lldb_private::ConstString> &imported_modules) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 79 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 80 | size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 81 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 82 | size_t ParseTypes(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 83 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 84 | size_t |
| 85 | ParseVariablesForContext(const lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 86 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 87 | lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override; |
| Adrian Prantl | eca07c5 | 2018-11-05 20:49:07 +0000 | [diff] [blame] | 88 | llvm::Optional<ArrayInfo> GetDynamicArrayInfoForUID( |
| 89 | lldb::user_id_t type_uid, |
| 90 | const lldb_private::ExecutionContext *exe_ctx) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 91 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 92 | bool CompleteType(lldb_private::CompilerType &compiler_type) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 93 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 94 | lldb_private::CompilerDecl GetDeclForUID(lldb::user_id_t uid) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 95 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 96 | lldb_private::CompilerDeclContext |
| 97 | GetDeclContextForUID(lldb::user_id_t uid) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 98 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 99 | lldb_private::CompilerDeclContext |
| 100 | GetDeclContextContainingUID(lldb::user_id_t uid) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 101 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 102 | void |
| 103 | ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 104 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 105 | uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, |
| Zachary Turner | 991e445 | 2018-10-25 20:45:19 +0000 | [diff] [blame] | 106 | lldb::SymbolContextItem resolve_scope, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 107 | lldb_private::SymbolContext &sc) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 108 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 109 | uint32_t |
| 110 | ResolveSymbolContext(const lldb_private::FileSpec &file_spec, uint32_t line, |
| Zachary Turner | 991e445 | 2018-10-25 20:45:19 +0000 | [diff] [blame] | 111 | bool check_inlines, |
| 112 | lldb::SymbolContextItem resolve_scope, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 113 | lldb_private::SymbolContextList &sc_list) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 114 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 115 | uint32_t |
| 116 | FindGlobalVariables(const lldb_private::ConstString &name, |
| 117 | const lldb_private::CompilerDeclContext *parent_decl_ctx, |
| Pavel Labath | 34cda14 | 2018-05-31 09:46:26 +0000 | [diff] [blame] | 118 | uint32_t max_matches, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 119 | lldb_private::VariableList &variables) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 120 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 121 | uint32_t FindGlobalVariables(const lldb_private::RegularExpression ®ex, |
| Pavel Labath | 34cda14 | 2018-05-31 09:46:26 +0000 | [diff] [blame] | 122 | uint32_t max_matches, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 123 | lldb_private::VariableList &variables) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 124 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 125 | uint32_t |
| 126 | FindFunctions(const lldb_private::ConstString &name, |
| 127 | const lldb_private::CompilerDeclContext *parent_decl_ctx, |
| Zachary Turner | 117b1fa | 2018-10-25 20:45:40 +0000 | [diff] [blame] | 128 | lldb::FunctionNameType name_type_mask, bool include_inlines, |
| 129 | bool append, lldb_private::SymbolContextList &sc_list) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 130 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 131 | uint32_t FindFunctions(const lldb_private::RegularExpression ®ex, |
| 132 | bool include_inlines, bool append, |
| 133 | lldb_private::SymbolContextList &sc_list) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 134 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 135 | void GetMangledNamesForFunction( |
| 136 | const std::string &scope_qualified_name, |
| 137 | std::vector<lldb_private::ConstString> &mangled_names) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 138 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 139 | uint32_t |
| 140 | FindTypes(const lldb_private::SymbolContext &sc, |
| 141 | const lldb_private::ConstString &name, |
| 142 | const lldb_private::CompilerDeclContext *parent_decl_ctx, |
| 143 | bool append, uint32_t max_matches, |
| 144 | llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, |
| 145 | lldb_private::TypeMap &types) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 146 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 147 | size_t FindTypes(const std::vector<lldb_private::CompilerContext> &context, |
| 148 | bool append, lldb_private::TypeMap &types) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 149 | |
| Aaron Smith | 364cbfe | 2017-12-28 06:29:59 +0000 | [diff] [blame] | 150 | void FindTypesByRegex(const lldb_private::RegularExpression ®ex, |
| Aaron Smith | c8316ed | 2018-03-22 03:44:51 +0000 | [diff] [blame] | 151 | uint32_t max_matches, lldb_private::TypeMap &types); |
| Aaron Smith | 364cbfe | 2017-12-28 06:29:59 +0000 | [diff] [blame] | 152 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 153 | lldb_private::TypeList *GetTypeList() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 154 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 155 | size_t GetTypes(lldb_private::SymbolContextScope *sc_scope, |
| Zachary Turner | 117b1fa | 2018-10-25 20:45:40 +0000 | [diff] [blame] | 156 | lldb::TypeClass type_mask, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 157 | lldb_private::TypeList &type_list) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 158 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 159 | lldb_private::TypeSystem * |
| 160 | GetTypeSystemForLanguage(lldb::LanguageType language) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 161 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 162 | lldb_private::CompilerDeclContext FindNamespace( |
| 163 | const lldb_private::SymbolContext &sc, |
| 164 | const lldb_private::ConstString &name, |
| 165 | const lldb_private::CompilerDeclContext *parent_decl_ctx) override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 166 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 167 | lldb_private::ConstString GetPluginName() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 168 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 169 | uint32_t GetPluginVersion() override; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 170 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 171 | llvm::pdb::IPDBSession &GetPDBSession(); |
| Zachary Turner | 42dff79 | 2016-04-15 00:21:26 +0000 | [diff] [blame] | 172 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 173 | const llvm::pdb::IPDBSession &GetPDBSession() const; |
| Zachary Turner | 42dff79 | 2016-04-15 00:21:26 +0000 | [diff] [blame] | 174 | |
| Zachary Turner | 4911023 | 2018-11-05 17:40:28 +0000 | [diff] [blame] | 175 | void DumpClangAST(lldb_private::Stream &s) override; |
| 176 | |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 177 | private: |
| Aleksandr Urakov | 356aa4a | 2018-10-23 08:29:17 +0000 | [diff] [blame] | 178 | struct SecContribInfo { |
| 179 | uint32_t Offset; |
| 180 | uint32_t Size; |
| 181 | uint32_t CompilandId; |
| 182 | }; |
| 183 | using SecContribsMap = std::map<uint32_t, std::vector<SecContribInfo>>; |
| 184 | |
| Aaron Smith | c8316ed | 2018-03-22 03:44:51 +0000 | [diff] [blame] | 185 | lldb::CompUnitSP ParseCompileUnitForUID(uint32_t id, |
| 186 | uint32_t index = UINT32_MAX); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 187 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 188 | bool ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc, |
| 189 | uint32_t match_line); |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 190 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 191 | void BuildSupportFileIdToSupportFileIndexMap( |
| Aaron Smith | 10a0257 | 2018-01-13 06:58:18 +0000 | [diff] [blame] | 192 | const llvm::pdb::PDBSymbolCompiland &pdb_compiland, |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 193 | llvm::DenseMap<uint32_t, uint32_t> &index_map) const; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 194 | |
| Aleksandr Urakov | c1e530e | 2018-11-06 08:02:55 +0000 | [diff] [blame^] | 195 | void FindTypesByName(llvm::StringRef name, |
| Aleksandr Urakov | 709426b | 2018-09-10 08:08:43 +0000 | [diff] [blame] | 196 | const lldb_private::CompilerDeclContext *parent_decl_ctx, |
| 197 | uint32_t max_matches, lldb_private::TypeMap &types); |
| Zachary Turner | 42dff79 | 2016-04-15 00:21:26 +0000 | [diff] [blame] | 198 | |
| Aaron Smith | cab0d23 | 2018-05-23 01:52:42 +0000 | [diff] [blame] | 199 | std::string GetMangledForPDBData(const llvm::pdb::PDBSymbolData &pdb_data); |
| 200 | |
| 201 | lldb::VariableSP |
| 202 | ParseVariableForPDBData(const lldb_private::SymbolContext &sc, |
| 203 | const llvm::pdb::PDBSymbolData &pdb_data); |
| 204 | |
| 205 | size_t ParseVariables(const lldb_private::SymbolContext &sc, |
| 206 | const llvm::pdb::PDBSymbol &pdb_data, |
| 207 | lldb_private::VariableList *variable_list = nullptr); |
| 208 | |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 209 | lldb::CompUnitSP |
| 210 | GetCompileUnitContainsAddress(const lldb_private::Address &so_addr); |
| 211 | |
| Aaron Smith | c8316ed | 2018-03-22 03:44:51 +0000 | [diff] [blame] | 212 | typedef std::vector<lldb_private::Type *> TypeCollection; |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 213 | |
| Aaron Smith | c8316ed | 2018-03-22 03:44:51 +0000 | [diff] [blame] | 214 | void GetTypesForPDBSymbol(const llvm::pdb::PDBSymbol &pdb_symbol, |
| 215 | uint32_t type_mask, |
| 216 | TypeCollection &type_collection); |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 217 | |
| Aaron Smith | c8316ed | 2018-03-22 03:44:51 +0000 | [diff] [blame] | 218 | lldb_private::Function * |
| 219 | ParseCompileUnitFunctionForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func, |
| 220 | const lldb_private::SymbolContext &sc); |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 221 | |
| Aaron Smith | e664b5d | 2018-03-19 21:14:19 +0000 | [diff] [blame] | 222 | void GetCompileUnitIndex(const llvm::pdb::PDBSymbolCompiland &pdb_compiland, |
| Aaron Smith | 10a0257 | 2018-01-13 06:58:18 +0000 | [diff] [blame] | 223 | uint32_t &index); |
| 224 | |
| Aaron Smith | 10a0257 | 2018-01-13 06:58:18 +0000 | [diff] [blame] | 225 | std::unique_ptr<llvm::pdb::PDBSymbolCompiland> |
| 226 | GetPDBCompilandByUID(uint32_t uid); |
| 227 | |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 228 | lldb_private::Mangled |
| Aaron Smith | e664b5d | 2018-03-19 21:14:19 +0000 | [diff] [blame] | 229 | GetMangledForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func); |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 230 | |
| Aaron Smith | e664b5d | 2018-03-19 21:14:19 +0000 | [diff] [blame] | 231 | bool ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func, |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 232 | bool include_inlines, |
| 233 | lldb_private::SymbolContextList &sc_list); |
| 234 | |
| 235 | bool ResolveFunction(uint32_t uid, bool include_inlines, |
| 236 | lldb_private::SymbolContextList &sc_list); |
| 237 | |
| 238 | void CacheFunctionNames(); |
| 239 | |
| 240 | bool DeclContextMatchesThisSymbolFile( |
| 241 | const lldb_private::CompilerDeclContext *decl_ctx); |
| 242 | |
| Aleksandr Urakov | 356aa4a | 2018-10-23 08:29:17 +0000 | [diff] [blame] | 243 | uint32_t GetCompilandId(const llvm::pdb::PDBSymbolData &data); |
| 244 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 245 | llvm::DenseMap<uint32_t, lldb::CompUnitSP> m_comp_units; |
| 246 | llvm::DenseMap<uint32_t, lldb::TypeSP> m_types; |
| Aaron Smith | cab0d23 | 2018-05-23 01:52:42 +0000 | [diff] [blame] | 247 | llvm::DenseMap<uint32_t, lldb::VariableSP> m_variables; |
| Aleksandr Urakov | 356aa4a | 2018-10-23 08:29:17 +0000 | [diff] [blame] | 248 | llvm::DenseMap<uint64_t, std::string> m_public_names; |
| 249 | |
| 250 | SecContribsMap m_sec_contribs; |
| Zachary Turner | 42dff79 | 2016-04-15 00:21:26 +0000 | [diff] [blame] | 251 | |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 252 | std::vector<lldb::TypeSP> m_builtin_types; |
| 253 | std::unique_ptr<llvm::pdb::IPDBSession> m_session_up; |
| Aaron Smith | 10a0257 | 2018-01-13 06:58:18 +0000 | [diff] [blame] | 254 | std::unique_ptr<llvm::pdb::PDBSymbolExe> m_global_scope_up; |
| Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 255 | uint32_t m_cached_compile_unit_count; |
| 256 | std::unique_ptr<lldb_private::CompilerDeclContext> m_tu_decl_ctx_up; |
| Aaron Smith | 7ac1c78 | 2018-02-09 05:31:28 +0000 | [diff] [blame] | 257 | |
| 258 | lldb_private::UniqueCStringMap<uint32_t> m_func_full_names; |
| 259 | lldb_private::UniqueCStringMap<uint32_t> m_func_base_names; |
| 260 | lldb_private::UniqueCStringMap<uint32_t> m_func_method_names; |
| Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 261 | }; |
| 262 | |
| 263 | #endif // lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_ |