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 "DWARFDefines.h"
13#include "lldb/lldb-private.h"
14
15#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
16
17#include <map>
18
19using DWARFAbbreviationDeclaration = llvm::DWARFAbbreviationDeclaration;
20
21typedef std::vector<DWARFAbbreviationDeclaration>
23typedef DWARFAbbreviationDeclarationColl::iterator
25typedef DWARFAbbreviationDeclarationColl::const_iterator
27
29public:
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.
40 llvm::Error extract(const lldb_private::DWARFDataExtractor &data,
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 /// Unit test accessor functions.
49 /// @{
51 /// @}
52private:
55 std::vector<DWARFAbbreviationDeclaration> m_decls;
56};
57
58typedef std::map<dw_offset_t, DWARFAbbreviationDeclarationSet>
60typedef DWARFAbbreviationDeclarationCollMap::iterator
62typedef DWARFAbbreviationDeclarationCollMap::const_iterator
64
66public:
69 GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const;
70 /// Extract all abbreviations for a particular compile unit. Returns
71 /// llvm::ErrorSuccess() on success, and an appropriate llvm::Error object
72 /// otherwise.
73 llvm::Error parse(const lldb_private::DWARFDataExtractor &data);
74 void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
75
76protected:
79};
80
81#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGABBREV_H
DWARFAbbreviationDeclarationCollMap::iterator DWARFAbbreviationDeclarationCollMapIter
DWARFAbbreviationDeclarationColl::const_iterator DWARFAbbreviationDeclarationCollConstIter
DWARFAbbreviationDeclarationColl::iterator DWARFAbbreviationDeclarationCollIter
std::map< dw_offset_t, DWARFAbbreviationDeclarationSet > DWARFAbbreviationDeclarationCollMap
DWARFAbbreviationDeclarationCollMap::const_iterator DWARFAbbreviationDeclarationCollMapConstIter
std::vector< DWARFAbbreviationDeclaration > DWARFAbbreviationDeclarationColl
llvm::DWARFAbbreviationDeclaration DWARFAbbreviationDeclaration
std::vector< DWARFAbbreviationDeclaration > m_decls
llvm::Error extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
Extract all abbrev decls in a set.
void GetUnsupportedForms(std::set< dw_form_t > &invalid_forms) const
DWARFAbbreviationDeclarationSet(dw_offset_t offset, uint32_t idx_offset)
const DWARFAbbreviationDeclaration * GetAbbreviationDeclaration(uint32_t abbrCode) const
uint32_t GetIndexOffset() const
Unit test accessor functions.
void GetUnsupportedForms(std::set< dw_form_t > &invalid_forms) const
const DWARFAbbreviationDeclarationSet * GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const
DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos
DWARFAbbreviationDeclarationCollMap m_abbrevCollMap
llvm::Error parse(const lldb_private::DWARFDataExtractor &data)
Extract all abbreviations for a particular compile unit.
uint64_t dw_offset_t
Definition: dwarf.h:31
#define DW_INVALID_OFFSET
Definition: dwarf.h:36
uint64_t offset_t
Definition: lldb-types.h:83