#include "DWARFDebugInfoEntry.h"
#include <cassert>
#include <algorithm>
#include <limits>
#include <optional>
#include "llvm/Support/LEB128.h"
#include "lldb/Core/Module.h"
#include "lldb/Expression/DWARFExpression.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
#include "DWARFCompileUnit.h"
#include "DWARFDebugAranges.h"
#include "DWARFDebugInfo.h"
#include "DWARFDebugRanges.h"
#include "DWARFDeclContext.h"
#include "DWARFFormValue.h"
#include "DWARFUnit.h"
#include "SymbolFileDWARF.h"
#include "SymbolFileDWARFDwo.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
usingnamespacelldb_private;
usingnamespacelldb_private::dwarf;
usingnamespacelldb_private::plugin::dwarf;
extern int g_verbose;
bool DWARFDebugInfoEntry::Extract(const DWARFDataExtractor &data,
const DWARFUnit &unit,
lldb::offset_t *offset_ptr) { … }
static DWARFRangeList GetRangesOrReportError(DWARFUnit &unit,
const DWARFDebugInfoEntry &die,
const DWARFFormValue &value) { … }
static void ExtractAttrAndFormValue(
const llvm::DWARFAbbreviationDeclaration::AttributeSpec &attr_spec,
dw_attr_t &attr, DWARFFormValue &form_value) { … }
bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
DWARFUnit *cu, const char *&name, const char *&mangled,
DWARFRangeList &ranges, std::optional<int> &decl_file,
std::optional<int> &decl_line, std::optional<int> &decl_column,
std::optional<int> &call_file, std::optional<int> &call_line,
std::optional<int> &call_column, DWARFExpressionList *frame_base) const { … }
void DWARFDebugInfoEntry::GetAttributes(DWARFUnit *cu,
DWARFAttributes &attributes,
Recurse recurse,
uint32_t curr_depth) const { … }
dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value,
dw_offset_t *end_attr_offset_ptr, bool check_elaborating_dies) const { … }
const char *DWARFDebugInfoEntry::GetAttributeValueAsString(
const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value,
bool check_elaborating_dies) const { … }
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(
const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value,
bool check_elaborating_dies) const { … }
std::optional<uint64_t>
DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned(
const DWARFUnit *cu, const dw_attr_t attr,
bool check_elaborating_dies) const { … }
DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference(
const DWARFUnit *cu, const dw_attr_t attr,
bool check_elaborating_dies) const { … }
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress(
const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value,
bool check_elaborating_dies) const { … }
dw_addr_t
DWARFDebugInfoEntry::GetAttributeHighPC(const DWARFUnit *cu, dw_addr_t lo_pc,
uint64_t fail_value,
bool check_elaborating_dies) const { … }
bool DWARFDebugInfoEntry::GetAttributeAddressRange(
const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc,
uint64_t fail_value, bool check_elaborating_dies) const { … }
DWARFRangeList DWARFDebugInfoEntry::GetAttributeAddressRanges(
DWARFUnit *cu, bool check_hi_lo_pc, bool check_elaborating_dies) const { … }
const char *DWARFDebugInfoEntry::GetName(const DWARFUnit *cu) const { … }
const char *
DWARFDebugInfoEntry::GetMangledName(const DWARFUnit *cu,
bool substitute_name_allowed) const { … }
const char *DWARFDebugInfoEntry::GetPubname(const DWARFUnit *cu) const { … }
void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { … }
lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset() const { … }
const llvm::DWARFAbbreviationDeclaration *
DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(const DWARFUnit *cu) const { … }
bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable() const { … }
bool DWARFDebugInfoEntry::operator==(const DWARFDebugInfoEntry &rhs) const { … }
bool DWARFDebugInfoEntry::operator!=(const DWARFDebugInfoEntry &rhs) const { … }