1 //===-- SymbolFileDWARFDwp.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 SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
11 #define SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
12 
13 #include <memory>
14 
15 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
16 
17 #include "lldb/Core/Module.h"
18 
19 #include "DWARFDataExtractor.h"
20 #include "SymbolFileDWARFDwo.h"
21 
22 class SymbolFileDWARFDwp {
23 public:
24   static std::unique_ptr<SymbolFileDWARFDwp>
25   Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec);
26 
27   std::unique_ptr<SymbolFileDWARFDwo>
28   GetSymbolFileForDwoId(DWARFUnit *dwarf_cu, uint64_t dwo_id);
29 
30   bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type,
31                        lldb_private::DWARFDataExtractor &data);
32 
33 private:
34   explicit SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
35                               lldb::ObjectFileSP obj_file);
36 
37   bool LoadRawSectionData(lldb::SectionType sect_type,
38                           lldb_private::DWARFDataExtractor &data);
39 
40   void InitDebugCUIndexMap();
41 
42   lldb::ObjectFileSP m_obj_file;
43 
44   std::mutex m_sections_mutex;
45   std::map<lldb::SectionType, lldb_private::DWARFDataExtractor> m_sections;
46 
47   llvm::DWARFUnitIndex m_debug_cu_index;
48   std::map<uint64_t, const llvm::DWARFUnitIndex::Entry *> m_debug_cu_index_map;
49 };
50 
51 #endif // SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
52