]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / SymbolFile / DWARF / DWARFDataExtractor.h
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 #include "lldb/Core/dwarf.h"
14 #include "lldb/Utility/DataExtractor.h"
15
16 namespace lldb_private {
17
18 class DWARFDataExtractor : public DataExtractor {
19 public:
20   DWARFDataExtractor() : DataExtractor(), m_is_dwarf64(false) {}
21
22   DWARFDataExtractor(const DWARFDataExtractor &data, lldb::offset_t offset,
23                      lldb::offset_t length)
24       : DataExtractor(data, offset, length), m_is_dwarf64(false) {}
25
26   uint64_t GetDWARFInitialLength(lldb::offset_t *offset_ptr) const;
27
28   dw_offset_t GetDWARFOffset(lldb::offset_t *offset_ptr) const;
29
30   size_t GetDWARFSizeofInitialLength() const { return m_is_dwarf64 ? 12 : 4; }
31   size_t GetDWARFSizeOfOffset() const { return m_is_dwarf64 ? 8 : 4; }
32   bool IsDWARF64() const { return m_is_dwarf64; }
33
34 protected:
35   mutable bool m_is_dwarf64;
36 };
37 }
38
39 #endif // liblldb_DWARFDataExtractor_h_