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);
44 void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
46 const DWARFAbbreviationDeclaration *
47 GetAbbreviationDeclaration(dw_uleb128_t abbrCode) const;
51 uint32_t m_idx_offset;
52 std::vector<DWARFAbbreviationDeclaration> m_decls;
55 typedef std::map<dw_offset_t, DWARFAbbreviationDeclarationSet>
56 DWARFAbbreviationDeclarationCollMap;
57 typedef DWARFAbbreviationDeclarationCollMap::iterator
58 DWARFAbbreviationDeclarationCollMapIter;
59 typedef DWARFAbbreviationDeclarationCollMap::const_iterator
60 DWARFAbbreviationDeclarationCollMapConstIter;
62 class DWARFDebugAbbrev {
65 const DWARFAbbreviationDeclarationSet *
66 GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const;
67 void Dump(lldb_private::Stream *s) const;
68 void Parse(const lldb_private::DWARFDataExtractor &data);
69 void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
72 DWARFAbbreviationDeclarationCollMap m_abbrevCollMap;
73 mutable DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos;
76 #endif // SymbolFileDWARF_DWARFDebugAbbrev_h_