LLDB  mainline
DWARFDebugAbbrev.h
Go to the documentation of this file.
1 //===-- DWARFDebugAbbrev.h --------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef SymbolFileDWARF_DWARFDebugAbbrev_h_
10 #define SymbolFileDWARF_DWARFDebugAbbrev_h_
11 
12 #include <list>
13 #include <map>
14 
15 #include "lldb/lldb-private.h"
16 
18 #include "DWARFDefines.h"
19 
20 typedef std::vector<DWARFAbbreviationDeclaration>
22 typedef DWARFAbbreviationDeclarationColl::iterator
24 typedef DWARFAbbreviationDeclarationColl::const_iterator
26 
28 public:
30  : m_offset(DW_INVALID_OFFSET), m_idx_offset(0), m_decls() {}
31 
33  : m_offset(offset), m_idx_offset(idx_offset), m_decls() {}
34 
35  void Clear();
36  dw_offset_t GetOffset() const { return m_offset; }
37 
38  /// Extract all abbrev decls in a set. Returns llvm::ErrorSuccess() on
39  /// success, and an appropriate llvm::Error object otherwise.
41  lldb::offset_t *offset_ptr);
42  // void Encode(BinaryStreamBuf& debug_abbrev_buf) const;
43  void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
44 
47 
48 private:
49  dw_offset_t m_offset;
50  uint32_t m_idx_offset;
51  std::vector<DWARFAbbreviationDeclaration> m_decls;
52 };
53 
54 typedef std::map<dw_offset_t, DWARFAbbreviationDeclarationSet>
56 typedef DWARFAbbreviationDeclarationCollMap::iterator
58 typedef DWARFAbbreviationDeclarationCollMap::const_iterator
60 
62 public:
65  GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const;
66  /// Extract all abbreviations for a particular compile unit. Returns
67  /// llvm::ErrorSuccess() on success, and an appropriate llvm::Error object
68  /// otherwise.
70  void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
71 
72 protected:
75 };
76 
77 #endif // SymbolFileDWARF_DWARFDebugAbbrev_h_
DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos
DWARFAbbreviationDeclarationColl::const_iterator DWARFAbbreviationDeclarationCollConstIter
llvm::Error Error
DWARFAbbreviationDeclarationCollMap::iterator DWARFAbbreviationDeclarationCollMapIter
DWARFAbbreviationDeclarationCollMap::const_iterator DWARFAbbreviationDeclarationCollMapConstIter
DWARFAbbreviationDeclarationColl::iterator DWARFAbbreviationDeclarationCollIter
std::vector< DWARFAbbreviationDeclaration > DWARFAbbreviationDeclarationColl
void GetUnsupportedForms(std::set< dw_form_t > &invalid_forms) const
uint64_t offset_t
Definition: lldb-types.h:87
DWARFAbbreviationDeclarationSet(dw_offset_t offset, uint32_t idx_offset)
DWARFAbbreviationDeclarationCollMap m_abbrevCollMap
#define DW_INVALID_OFFSET
Definition: dwarf.h:34
const DWARFAbbreviationDeclaration * GetAbbreviationDeclaration(dw_uleb128_t abbrCode) const
std::map< dw_offset_t, DWARFAbbreviationDeclarationSet > DWARFAbbreviationDeclarationCollMap
llvm::Error extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
Extract all abbrev decls in a set.