Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- SymbolFileSymtab.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 liblldb_SymbolFileSymtab_h_ |
| 11 | #define liblldb_SymbolFileSymtab_h_ |
| 12 | |
| 13 | #include "lldb/Symbol/SymbolFile.h" |
| 14 | #include <vector> |
| 15 | |
| 16 | class SymbolFileSymtab : public lldb_private::SymbolFile |
| 17 | { |
| 18 | public: |
| 19 | //------------------------------------------------------------------ |
| 20 | // Static Functions |
| 21 | //------------------------------------------------------------------ |
| 22 | static void |
| 23 | Initialize(); |
| 24 | |
| 25 | static void |
| 26 | Terminate(); |
| 27 | |
| 28 | static const char * |
| 29 | GetPluginNameStatic(); |
| 30 | |
| 31 | static const char * |
| 32 | GetPluginDescriptionStatic(); |
| 33 | |
| 34 | static lldb_private::SymbolFile* |
| 35 | CreateInstance (lldb_private::ObjectFile* obj_file); |
| 36 | |
| 37 | //------------------------------------------------------------------ |
| 38 | // Constructors and Destructors |
| 39 | //------------------------------------------------------------------ |
| 40 | SymbolFileSymtab(lldb_private::ObjectFile* obj_file); |
| 41 | |
| 42 | virtual |
| 43 | ~SymbolFileSymtab(); |
| 44 | |
| 45 | virtual uint32_t GetAbilities (); |
| 46 | |
| 47 | //------------------------------------------------------------------ |
| 48 | // Compile Unit function calls |
| 49 | //------------------------------------------------------------------ |
| 50 | virtual uint32_t |
| 51 | GetNumCompileUnits(); |
| 52 | |
| 53 | virtual lldb::CompUnitSP |
| 54 | ParseCompileUnitAtIndex(uint32_t index); |
| 55 | |
| 56 | virtual size_t |
| 57 | ParseCompileUnitFunctions (const lldb_private::SymbolContext& sc); |
| 58 | |
| 59 | virtual bool |
| 60 | ParseCompileUnitLineTable (const lldb_private::SymbolContext& sc); |
| 61 | |
| 62 | virtual bool |
| 63 | ParseCompileUnitSupportFiles (const lldb_private::SymbolContext& sc, lldb_private::FileSpecList &support_files); |
| 64 | |
| 65 | virtual size_t |
| 66 | ParseFunctionBlocks (const lldb_private::SymbolContext& sc); |
| 67 | |
| 68 | virtual size_t |
| 69 | ParseTypes (const lldb_private::SymbolContext& sc); |
| 70 | |
| 71 | virtual size_t |
| 72 | ParseVariablesForContext (const lldb_private::SymbolContext& sc); |
| 73 | |
| 74 | virtual lldb_private::Type* |
| 75 | ResolveTypeUID(lldb::user_id_t type_uid); |
| 76 | |
| 77 | virtual uint32_t |
| 78 | ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); |
| 79 | |
| 80 | virtual uint32_t |
| 81 | ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); |
| 82 | |
| 83 | virtual uint32_t |
| 84 | FindGlobalVariables(const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::VariableList& variables); |
| 85 | |
| 86 | virtual uint32_t |
| 87 | FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables); |
| 88 | |
| 89 | virtual uint32_t |
Greg Clayton | 12bec71 | 2010-06-28 21:30:43 +0000 | [diff] [blame] | 90 | FindFunctions(const lldb_private::ConstString &name, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 91 | |
| 92 | virtual uint32_t |
| 93 | FindFunctions(const lldb_private::RegularExpression& regex, bool append, lldb_private::SymbolContextList& sc_list); |
| 94 | |
Greg Clayton | 960d6a4 | 2010-08-03 00:35:52 +0000 | [diff] [blame] | 95 | virtual uint32_t |
| 96 | FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::TypeList& types); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 97 | |
| 98 | // virtual uint32_t |
Greg Clayton | 960d6a4 | 2010-08-03 00:35:52 +0000 | [diff] [blame] | 99 | // FindTypes(const lldb_private::SymbolContext& sc, const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::TypeList& types); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 100 | |
| 101 | //------------------------------------------------------------------ |
| 102 | // PluginInterface protocol |
| 103 | //------------------------------------------------------------------ |
| 104 | virtual const char * |
| 105 | GetPluginName(); |
| 106 | |
| 107 | virtual const char * |
| 108 | GetShortPluginName(); |
| 109 | |
| 110 | virtual uint32_t |
| 111 | GetPluginVersion(); |
| 112 | |
| 113 | virtual void |
| 114 | GetPluginCommandHelp (const char *command, lldb_private::Stream *strm); |
| 115 | |
| 116 | virtual lldb_private::Error |
| 117 | ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm); |
| 118 | |
| 119 | virtual lldb_private::Log * |
| 120 | EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command); |
| 121 | |
| 122 | |
| 123 | |
| 124 | protected: |
| 125 | std::vector<uint32_t> m_source_indexes; |
| 126 | std::vector<uint32_t> m_func_indexes; |
| 127 | std::vector<uint32_t> m_code_indexes; |
| 128 | std::vector<uint32_t> m_data_indexes; |
| 129 | std::vector<uint32_t> m_addr_indexes; // Anything that needs to go into an search by address |
| 130 | |
| 131 | private: |
| 132 | DISALLOW_COPY_AND_ASSIGN (SymbolFileSymtab); |
| 133 | }; |
| 134 | |
| 135 | |
| 136 | #endif // liblldb_SymbolFileSymtab_h_ |