xref: /trueos/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h (revision 958843c32b7a29741f2e45996b5b3e89f9e108b0)
1 //===-- DWARFDataExtractor.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_DWARFDataExtractor_h_
11 #define liblldb_DWARFDataExtractor_h_
12 
13 // Other libraries and framework includes.
14 #include "lldb/Core/DataExtractor.h"
15 #include "lldb/Core/dwarf.h"
16 
17 namespace lldb_private {
18 
19 class DWARFDataExtractor : public lldb_private::DataExtractor
20 {
21 public:
DWARFDataExtractor()22     DWARFDataExtractor() : DataExtractor(), m_is_dwarf64(false) { };
23 
DWARFDataExtractor(const DWARFDataExtractor & data,lldb::offset_t offset,lldb::offset_t length)24     DWARFDataExtractor (const DWARFDataExtractor& data, lldb::offset_t offset, lldb::offset_t length) :
25       DataExtractor(data, offset, length), m_is_dwarf64(false) { };
26 
27     uint64_t
28     GetDWARFInitialLength(lldb::offset_t *offset_ptr) const;
29 
30     dw_offset_t
31     GetDWARFOffset(lldb::offset_t *offset_ptr) const;
32 
33     size_t
GetDWARFSizeofInitialLength()34     GetDWARFSizeofInitialLength() const { return m_is_dwarf64 ? 12 : 4; }
35 
36 protected:
37     mutable bool m_is_dwarf64;
38 };
39 
40 }
41 
42 #endif  // liblldb_DWARFDataExtractor_h_
43 
44