1 //===-- DWARFDebugAbbrev.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef SymbolFileDWARF_DWARFDebugAbbrev_h_
11 #define SymbolFileDWARF_DWARFDebugAbbrev_h_
16 #include "lldb/lldb-private.h"
18 #include "DWARFAbbreviationDeclaration.h"
19 #include "DWARFDefines.h"
21 typedef std::vector<DWARFAbbreviationDeclaration>
22 DWARFAbbreviationDeclarationColl;
23 typedef DWARFAbbreviationDeclarationColl::iterator
24 DWARFAbbreviationDeclarationCollIter;
25 typedef DWARFAbbreviationDeclarationColl::const_iterator
26 DWARFAbbreviationDeclarationCollConstIter;
28 class DWARFAbbreviationDeclarationSet {
30 DWARFAbbreviationDeclarationSet()
31 : m_offset(DW_INVALID_OFFSET), m_idx_offset(0), m_decls() {}
33 DWARFAbbreviationDeclarationSet(dw_offset_t offset, uint32_t idx_offset)
34 : m_offset(offset), m_idx_offset(idx_offset), m_decls() {}
37 dw_offset_t GetOffset() const { return m_offset; }
38 void Dump(lldb_private::Stream *s) const;
39 bool Extract(const lldb_private::DWARFDataExtractor &data,
40 lldb::offset_t *offset_ptr);
41 // void Encode(BinaryStreamBuf& debug_abbrev_buf) const;
43 AppendAbbrevDeclSequential(const DWARFAbbreviationDeclaration &abbrevDecl);
45 const DWARFAbbreviationDeclaration *
46 GetAbbreviationDeclaration(dw_uleb128_t abbrCode) const;
50 uint32_t m_idx_offset;
51 std::vector<DWARFAbbreviationDeclaration> m_decls;
54 typedef std::map<dw_offset_t, DWARFAbbreviationDeclarationSet>
55 DWARFAbbreviationDeclarationCollMap;
56 typedef DWARFAbbreviationDeclarationCollMap::iterator
57 DWARFAbbreviationDeclarationCollMapIter;
58 typedef DWARFAbbreviationDeclarationCollMap::const_iterator
59 DWARFAbbreviationDeclarationCollMapConstIter;
61 class DWARFDebugAbbrev {
64 const DWARFAbbreviationDeclarationSet *
65 GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const;
66 void Dump(lldb_private::Stream *s) const;
67 void Parse(const lldb_private::DWARFDataExtractor &data);
70 DWARFAbbreviationDeclarationCollMap m_abbrevCollMap;
71 mutable DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos;
74 #endif // SymbolFileDWARF_DWARFDebugAbbrev_h_