]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / source / Plugins / SymbolFile / DWARF / DWARFDebugMacro.h
1 //===-- DWARFDebugMacro.h ----------------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef SymbolFileDWARF_DWARFDebugMacro_h_
12 #define SymbolFileDWARF_DWARFDebugMacro_h_
13
14 #include <map>
15
16 #include "lldb/Core/dwarf.h"
17 #include "lldb/Symbol/DebugMacros.h"
18 #include "lldb/lldb-types.h"
19
20 namespace lldb_private {
21
22 class DWARFDataExtractor;
23
24 } // namespace lldb_private
25
26 class SymbolFileDWARF;
27
28 class DWARFDebugMacroHeader {
29 public:
30   enum HeaderFlagMask {
31     OFFSET_SIZE_MASK = 0x1,
32     DEBUG_LINE_OFFSET_MASK = 0x2,
33     OPCODE_OPERANDS_TABLE_MASK = 0x4
34   };
35
36   static DWARFDebugMacroHeader
37   ParseHeader(const lldb_private::DWARFDataExtractor &debug_macro_data,
38               lldb::offset_t *offset);
39
40   bool OffsetIs64Bit() const { return m_offset_is_64_bit; }
41
42 private:
43   static void
44   SkipOperandTable(const lldb_private::DWARFDataExtractor &debug_macro_data,
45                    lldb::offset_t *offset);
46
47   uint16_t m_version;
48   bool m_offset_is_64_bit;
49   uint64_t m_debug_line_offset;
50 };
51
52 class DWARFDebugMacroEntry {
53 public:
54   static void
55   ReadMacroEntries(const lldb_private::DWARFDataExtractor &debug_macro_data,
56                    const lldb_private::DWARFDataExtractor &debug_str_data,
57                    const bool offset_is_64_bit, lldb::offset_t *sect_offset,
58                    SymbolFileDWARF *sym_file_dwarf,
59                    lldb_private::DebugMacrosSP &debug_macros_sp);
60 };
61
62 #endif // SymbolFileDWARF_DWARFDebugMacro_h_