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 LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGABBREV_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_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 
32  : m_offset(offset), m_idx_offset(idx_offset), m_decls() {}
33 
34  void Clear();
35  dw_offset_t GetOffset() const { return m_offset; }
36 
37  /// Extract all abbrev decls in a set. Returns llvm::ErrorSuccess() on
38  /// success, and an appropriate llvm::Error object otherwise.
40  lldb::offset_t *offset_ptr);
41  // void Encode(BinaryStreamBuf& debug_abbrev_buf) const;
42  void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
43 
46 
47  /// Unit test accessor functions.
48  /// @{
49  uint32_t GetIndexOffset() const { return m_idx_offset; }
50  /// @}
51 private:
54  std::vector<DWARFAbbreviationDeclaration> m_decls;
55 };
56 
57 typedef std::map<dw_offset_t, DWARFAbbreviationDeclarationSet>
59 typedef DWARFAbbreviationDeclarationCollMap::iterator
61 typedef DWARFAbbreviationDeclarationCollMap::const_iterator
63 
65 public:
68  GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const;
69  /// Extract all abbreviations for a particular compile unit. Returns
70  /// llvm::ErrorSuccess() on success, and an appropriate llvm::Error object
71  /// otherwise.
73  void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
74 
75 protected:
78 };
79 
80 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGABBREV_H
DWARFAbbreviationDeclarationCollConstIter
DWARFAbbreviationDeclarationColl::const_iterator DWARFAbbreviationDeclarationCollConstIter
Definition: DWARFDebugAbbrev.h:25
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
DWARFAbbreviationDeclarationSet::DWARFAbbreviationDeclarationSet
DWARFAbbreviationDeclarationSet(dw_offset_t offset, uint32_t idx_offset)
Definition: DWARFDebugAbbrev.h:31
lldb_private::DWARFDataExtractor
Definition: DWARFDataExtractor.h:18
DW_INVALID_OFFSET
#define DW_INVALID_OFFSET
Definition: dwarf.h:34
DWARFAbbreviationDeclarationColl
std::vector< DWARFAbbreviationDeclaration > DWARFAbbreviationDeclarationColl
Definition: DWARFDebugAbbrev.h:21
DWARFDefines.h
DWARFAbbreviationDeclarationSet::GetOffset
dw_offset_t GetOffset() const
Definition: DWARFDebugAbbrev.h:35
DWARFAbbreviationDeclarationCollMapConstIter
DWARFAbbreviationDeclarationCollMap::const_iterator DWARFAbbreviationDeclarationCollMapConstIter
Definition: DWARFDebugAbbrev.h:62
DWARFAbbreviationDeclarationSet::DWARFAbbreviationDeclarationSet
DWARFAbbreviationDeclarationSet()
Definition: DWARFDebugAbbrev.h:29
DWARFDebugAbbrev::m_prev_abbr_offset_pos
DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos
Definition: DWARFDebugAbbrev.h:77
DWARFDebugAbbrev::GetUnsupportedForms
void GetUnsupportedForms(std::set< dw_form_t > &invalid_forms) const
Definition: DWARFDebugAbbrev.cpp:142
DWARFAbbreviationDeclarationSet::GetIndexOffset
uint32_t GetIndexOffset() const
Unit test accessor functions.
Definition: DWARFDebugAbbrev.h:49
DWARFAbbreviationDeclarationCollMapIter
DWARFAbbreviationDeclarationCollMap::iterator DWARFAbbreviationDeclarationCollMapIter
Definition: DWARFDebugAbbrev.h:60
DWARFAbbreviationDeclaration.h
DWARFAbbreviationDeclarationCollIter
DWARFAbbreviationDeclarationColl::iterator DWARFAbbreviationDeclarationCollIter
Definition: DWARFDebugAbbrev.h:23
DWARFAbbreviationDeclarationSet::extract
llvm::Error extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
Extract all abbrev decls in a set.
Definition: DWARFDebugAbbrev.cpp:25
lldb-private.h
DWARFDebugAbbrev
Definition: DWARFDebugAbbrev.h:64
DWARFDebugAbbrev::m_abbrevCollMap
DWARFAbbreviationDeclarationCollMap m_abbrevCollMap
Definition: DWARFDebugAbbrev.h:76
DWARFAbbreviationDeclarationSet::Clear
void Clear()
Definition: DWARFDebugAbbrev.cpp:18
DWARFAbbreviationDeclarationSet
Definition: DWARFDebugAbbrev.h:27
uint32_t
DWARFAbbreviationDeclarationSet::m_idx_offset
uint32_t m_idx_offset
Definition: DWARFDebugAbbrev.h:53
DWARFDebugAbbrev::parse
llvm::Error parse(const lldb_private::DWARFDataExtractor &data)
Extract all abbreviations for a particular compile unit.
Definition: DWARFDebugAbbrev.cpp:105
DWARFAbbreviationDeclaration
Definition: DWARFAbbreviationDeclaration.h:17
DWARFAbbreviationDeclarationCollMap
std::map< dw_offset_t, DWARFAbbreviationDeclarationSet > DWARFAbbreviationDeclarationCollMap
Definition: DWARFDebugAbbrev.h:58
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
DWARFAbbreviationDeclarationSet::m_decls
std::vector< DWARFAbbreviationDeclaration > m_decls
Definition: DWARFDebugAbbrev.h:54
DWARFDebugAbbrev::GetAbbreviationDeclarationSet
const DWARFAbbreviationDeclarationSet * GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const
Definition: DWARFDebugAbbrev.cpp:124
DWARFAbbreviationDeclarationSet::m_offset
dw_offset_t m_offset
Definition: DWARFDebugAbbrev.h:52
DWARFAbbreviationDeclarationSet::GetUnsupportedForms
void GetUnsupportedForms(std::set< dw_form_t > &invalid_forms) const
Definition: DWARFDebugAbbrev.cpp:72
DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration
const DWARFAbbreviationDeclaration * GetAbbreviationDeclaration(dw_uleb128_t abbrCode) const
Definition: DWARFDebugAbbrev.cpp:53
DWARFDebugAbbrev::DWARFDebugAbbrev
DWARFDebugAbbrev()
Definition: DWARFDebugAbbrev.cpp:101