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