Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
//===-- DWARFAbbreviationDeclaration.h --------------------------*- C++ -*-===// | //===-- DWARFAbbreviationDeclaration.h --------------------------*- C++ -*-===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef liblldb_DWARFAbbreviationDeclaration_h_ | #ifndef liblldb_DWARFAbbreviationDeclaration_h_ | ||||
#define liblldb_DWARFAbbreviationDeclaration_h_ | #define liblldb_DWARFAbbreviationDeclaration_h_ | ||||
#include "DWARFAttribute.h" | #include "DWARFAttribute.h" | ||||
#include "DWARFDefines.h" | |||||
#include "SymbolFileDWARF.h" | #include "SymbolFileDWARF.h" | ||||
#include "llvm/Support/Error.h" | |||||
class DWARFAbbreviationDeclaration { | class DWARFAbbreviationDeclaration { | ||||
public: | public: | ||||
enum { InvalidCode = 0 }; | enum { InvalidCode = 0 }; | ||||
DWARFAbbreviationDeclaration(); | DWARFAbbreviationDeclaration(); | ||||
// For hand crafting an abbreviation declaration | // For hand crafting an abbreviation declaration | ||||
DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t has_children); | DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t has_children); | ||||
Show All 17 Lines | public: | ||||
void GetAttrAndFormValueByIndex(uint32_t idx, dw_attr_t &attr, | void GetAttrAndFormValueByIndex(uint32_t idx, dw_attr_t &attr, | ||||
DWARFFormValue &form_value) const { | DWARFFormValue &form_value) const { | ||||
m_attributes[idx].get(attr, form_value.FormRef(), form_value.ValueRef()); | m_attributes[idx].get(attr, form_value.FormRef(), form_value.ValueRef()); | ||||
} | } | ||||
dw_form_t GetFormByIndexUnchecked(uint32_t idx) const { | dw_form_t GetFormByIndexUnchecked(uint32_t idx) const { | ||||
return m_attributes[idx].get_form(); | return m_attributes[idx].get_form(); | ||||
} | } | ||||
uint32_t FindAttributeIndex(dw_attr_t attr) const; | uint32_t FindAttributeIndex(dw_attr_t attr) const; | ||||
bool Extract(const lldb_private::DWARFDataExtractor &data, | |||||
/// Extract one abbreviation declaration and all of its associated attributes. | |||||
aprantl: half-finished comment? | |||||
/// 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); | lldb::offset_t *offset_ptr); | ||||
bool Extract(const lldb_private::DWARFDataExtractor &data, | |||||
lldb::offset_t *offset_ptr, dw_uleb128_t code); | |||||
bool IsValid(); | bool IsValid(); | ||||
void Dump(lldb_private::Stream *s) const; | void Dump(lldb_private::Stream *s) const; | ||||
bool operator==(const DWARFAbbreviationDeclaration &rhs) const; | bool operator==(const DWARFAbbreviationDeclaration &rhs) const; | ||||
const DWARFAttribute::collection &Attributes() const { return m_attributes; } | const DWARFAttribute::collection &Attributes() const { return m_attributes; } | ||||
protected: | protected: | ||||
dw_uleb128_t m_code; | dw_uleb128_t m_code; | ||||
dw_tag_t m_tag; | dw_tag_t m_tag; | ||||
uint8_t m_has_children; | uint8_t m_has_children; | ||||
DWARFAttribute::collection m_attributes; | DWARFAttribute::collection m_attributes; | ||||
}; | }; | ||||
#endif // liblldb_DWARFAbbreviationDeclaration_h_ | #endif // liblldb_DWARFAbbreviationDeclaration_h_ |
half-finished comment?