summaryrefslogtreecommitdiff
path: root/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h')
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
index afce52558f45..c0cf8823a368 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
@@ -1,9 +1,8 @@
//===-- DWARFAbbreviationDeclaration.h --------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -11,7 +10,9 @@
#define liblldb_DWARFAbbreviationDeclaration_h_
#include "DWARFAttribute.h"
+#include "DWARFDefines.h"
#include "SymbolFileDWARF.h"
+#include "llvm/Support/Error.h"
class DWARFAbbreviationDeclaration {
public:
@@ -20,18 +21,12 @@ public:
// For hand crafting an abbreviation declaration
DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t has_children);
- void AddAttribute(const DWARFAttribute &attr) {
- m_attributes.push_back(attr);
- }
dw_uleb128_t Code() const { return m_code; }
void SetCode(dw_uleb128_t code) { m_code = code; }
dw_tag_t Tag() const { return m_tag; }
bool HasChildren() const { return m_has_children; }
size_t NumAttributes() const { return m_attributes.size(); }
- dw_attr_t GetAttrByIndex(uint32_t idx) const {
- return m_attributes.size() > idx ? m_attributes[idx].get_attr() : 0;
- }
dw_form_t GetFormByIndex(uint32_t idx) const {
return m_attributes.size() > idx ? m_attributes[idx].get_form() : 0;
}
@@ -45,14 +40,20 @@ public:
return m_attributes[idx].get_form();
}
uint32_t FindAttributeIndex(dw_attr_t attr) const;
- bool Extract(const lldb_private::DWARFDataExtractor &data,
- lldb::offset_t *offset_ptr);
- bool Extract(const lldb_private::DWARFDataExtractor &data,
- lldb::offset_t *offset_ptr, dw_uleb128_t code);
+
+ /// Extract one abbreviation declaration and all of its associated attributes.
+ /// Possible return values:
+ /// DWARFEnumState::Complete - the extraction completed successfully. This
+ /// was the last abbrev decl in a sequence, and the user should not call
+ /// this function again.
+ /// DWARFEnumState::MoreItems - the extraction completed successfully. The
+ /// user should call this function again to retrieve the next decl.
+ /// llvm::Error - A parsing error occurred. The debug info is malformed.
+ llvm::Expected<lldb_private::DWARFEnumState>
+ extract(const lldb_private::DWARFDataExtractor &data,
+ lldb::offset_t *offset_ptr);
bool IsValid();
- void Dump(lldb_private::Stream *s) const;
bool operator==(const DWARFAbbreviationDeclaration &rhs) const;
- const DWARFAttribute::collection &Attributes() const { return m_attributes; }
protected:
dw_uleb128_t m_code;