xref: /freebsd-11-stable/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h (revision 8ce8be0a003b95ab7796df15e97ca5944b8536ac)
1 //===-- SymbolFileDWARFDwp.h ------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
10 #define SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
11 
12 #include <memory>
13 
14 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
15 
16 #include "lldb/Core/Module.h"
17 
18 #include "DWARFDataExtractor.h"
19 #include "SymbolFileDWARFDwo.h"
20 
21 class SymbolFileDWARFDwp {
22 public:
23   static std::unique_ptr<SymbolFileDWARFDwp>
24   Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec);
25 
26   std::unique_ptr<SymbolFileDWARFDwo>
27   GetSymbolFileForDwoId(DWARFCompileUnit &dwarf_cu, uint64_t dwo_id);
28 
29   bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type,
30                        lldb_private::DWARFDataExtractor &data);
31 
32 private:
33   explicit SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
34                               lldb::ObjectFileSP obj_file);
35 
36   bool LoadRawSectionData(lldb::SectionType sect_type,
37                           lldb_private::DWARFDataExtractor &data);
38 
39   void InitDebugCUIndexMap();
40 
41   lldb::ObjectFileSP m_obj_file;
42 
43   std::mutex m_sections_mutex;
44   std::map<lldb::SectionType, lldb_private::DWARFDataExtractor> m_sections;
45 
46   llvm::DWARFUnitIndex m_debug_cu_index;
47   std::map<uint64_t, const llvm::DWARFUnitIndex::Entry *> m_debug_cu_index_map;
48 };
49 
50 #endif // SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
51