AppleDWARFIndex.h revision 336985
1//===-- AppleDWARFIndex.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_APPLEDWARFINDEX_H 11#define LLDB_APPLEDWARFINDEX_H 12 13#include "Plugins/SymbolFile/DWARF/DWARFIndex.h" 14#include "Plugins/SymbolFile/DWARF/HashedNameToDIE.h" 15 16namespace lldb_private { 17class AppleDWARFIndex : public DWARFIndex { 18public: 19 static std::unique_ptr<AppleDWARFIndex> 20 Create(Module &module, DWARFDataExtractor apple_names, 21 DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, 22 DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str); 23 24 AppleDWARFIndex( 25 Module &module, std::unique_ptr<DWARFMappedHash::MemoryTable> apple_names, 26 std::unique_ptr<DWARFMappedHash::MemoryTable> apple_namespaces, 27 std::unique_ptr<DWARFMappedHash::MemoryTable> apple_types, 28 std::unique_ptr<DWARFMappedHash::MemoryTable> apple_objc) 29 : DWARFIndex(module), m_apple_names_up(std::move(apple_names)), 30 m_apple_namespaces_up(std::move(apple_namespaces)), 31 m_apple_types_up(std::move(apple_types)), 32 m_apple_objc_up(std::move(apple_objc)) {} 33 34 void Preload() override {} 35 36 void GetGlobalVariables(ConstString basename, DIEArray &offsets) override; 37 void GetGlobalVariables(const RegularExpression ®ex, 38 DIEArray &offsets) override; 39 void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override; 40 void GetObjCMethods(ConstString class_name, DIEArray &offsets) override; 41 void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, 42 DIEArray &offsets) override; 43 void GetTypes(ConstString name, DIEArray &offsets) override; 44 void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override; 45 void GetNamespaces(ConstString name, DIEArray &offsets) override; 46 void GetFunctions(ConstString name, DWARFDebugInfo &info, 47 const CompilerDeclContext &parent_decl_ctx, 48 uint32_t name_type_mask, 49 std::vector<DWARFDIE> &dies) override; 50 void GetFunctions(const RegularExpression ®ex, DIEArray &offsets) override; 51 52 void ReportInvalidDIEOffset(dw_offset_t offset, 53 llvm::StringRef name) override; 54 void Dump(Stream &s) override; 55 56private: 57 std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up; 58 std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up; 59 std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up; 60 std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up; 61}; 62} // namespace lldb_private 63 64#endif // LLDB_APPLEDWARFINDEX_H 65