9#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
16#include "llvm/DebugInfo/DWARF/DWARFDebugRnglists.h"
17#include "llvm/Support/RWMutex.h"
78 static llvm::Expected<DWARFUnitHeader>
86 llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>;
89 static llvm::Expected<DWARFUnitSP>
258 std::unique_ptr<llvm::DWARFLocationTable>
270 bool HasAny(llvm::ArrayRef<dw_tag_t> tags);
static llvm::raw_ostream & error(Stream &strm)
llvm::DWARFAbbreviationDeclarationSet DWARFAbbreviationDeclarationSet
std::shared_ptr< DWARFUnit > DWARFUnitSP
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
std::vector< DWARFDebugInfoEntry > collection
SymbolFileDWARFDwo * GetDwoSymbolFile()
std::optional< uint64_t > GetLoclistOffset(uint32_t Index)
void * GetUserData() const
bool m_rnglist_table_done
DIERef::Section GetDebugSection() const
const DIERef::Section m_section
lldb_private::FileSpec::Style GetPathStyle()
SymbolFileDWARF & GetSymbolFileDWARF() const
void ExtractDIEsIfNeeded()
lldb_private::Status m_dwo_error
If we get an error when trying to load a .dwo file, save that error here.
uint8_t GetUnitType() const
dw_offset_t GetAbbrevOffset() const
virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges)=0
dw_addr_t m_loclists_base
Value of DW_AT_loclists_base.
void ExtractUnitDIEIfNeeded()
void SetDwoError(const lldb_private::Status &error)
Set the fission .dwo file specific error for this compile unit.
DWARFDebugInfoEntry::collection m_die_array
const DWARFDebugInfoEntry * GetUnitDIEPtrOnly()
void ExtractUnitDIENoDwoIfNeeded()
llvm::iterator_range< DWARFDebugInfoEntry::collection::iterator > die_iterator_range
void SetStrOffsetsBase(dw_offset_t str_offsets_base)
dw_offset_t m_str_offsets_base
void SetLoclistsBase(dw_addr_t loclists_base)
virtual void Dump(lldb_private::Stream *s) const =0
void SetDwoStrOffsetsBase()
const DWARFDebugAranges & GetFunctionAranges()
std::optional< uint64_t > m_language_type
dw_offset_t GetLineTableOffset()
dw_offset_t GetFirstDIEOffset() const
std::atomic< bool > m_cancel_scopes
bool m_has_parsed_non_skeleton_unit
bool Supports_DW_AT_APPLE_objc_complete_type()
const lldb_private::DWARFDataExtractor & GetData() const
Get the data that contains the DIE information for this unit.
bool DW_AT_decl_file_attributes_are_invalid()
DWARFBaseDIE GetUnitDIEOnly()
dw_addr_t ReadAddressFromDebugAddrSection(uint32_t index) const
std::optional< uint64_t > m_gnu_addr_base
uint16_t GetVersion() const
std::optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
lldb_private::LazyBool m_is_optimized
llvm::VersionTuple m_producer_version
dw_addr_t GetAddrBase() const
llvm::Error ExtractHeader(SymbolFileDWARF &dwarf, const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
void SetBaseAddress(dw_addr_t base_addr)
void ComputeCompDirAndGuessPathStyle()
const lldb_private::Status & GetDwoError() const
Get the fission .dwo file specific error for this compile unit.
std::optional< dw_addr_t > m_addr_base
Value of DW_AT_addr_base.
void SetUserData(void *d)
size_t GetDebugInfoSize() const
lldb_private::DWARFDataExtractor GetLocationData() const
const std::optional< llvm::DWARFDebugRnglistTable > & GetRnglistTable()
bool IsSkeletonUnit() const
Note that this check only works for DWARF5+.
llvm::sys::RWMutex m_die_array_scoped_mutex
const lldb_private::FileSpec & GetAbsolutePath()
llvm::Expected< uint64_t > GetRnglistOffset(uint32_t Index)
Return a rangelist's offset based on an index.
std::optional< lldb_private::FileSpec > m_file_spec
const DWARFUnit & operator=(const DWARFUnit &)=delete
bool Verify(lldb_private::Stream *s) const
dw_addr_t GetStrOffsetsBase() const
DWARFUnit(const DWARFUnit &)=delete
bool Supports_unnamed_objc_bitfields()
uint8_t GetAddressByteSize() const
std::unique_ptr< llvm::DWARFLocationTable > GetLocationTable(const lldb_private::DataExtractor &data) const
Return the location table for parsing the given location list data.
llvm::sys::RWMutex m_die_array_mutex
DWARFDebugInfoEntry m_first_die
void SetRangesBase(dw_addr_t ranges_base)
uint32_t GetHeaderByteSize() const
Get the size in bytes of the unit header.
ScopedExtractDIEs ExtractDIEsScoped()
void SetAddrBase(dw_addr_t addr_base)
static llvm::Expected< DWARFUnitSP > extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const lldb_private::DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr)
llvm::Expected< DWARFRangeList > FindRnglistFromIndex(uint32_t index)
Return a list of address ranges retrieved from an encoded range list whose offset is found via a tabl...
void ExtractDIEsRWLocked()
llvm::VersionTuple GetProducerVersion()
static uint8_t GetDefaultAddressSize()
std::optional< uint64_t > m_gnu_ranges_base
dw_offset_t GetNextUnitOffset() const
uint64_t GetDWARFLanguageType()
SymbolFileDWARF & m_dwarf
void ComputeAbsolutePath()
dw_addr_t GetRangesBase() const
std::optional< uint64_t > m_dwo_id
Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
const DWARFDebugInfoEntry * DIEPtr()
size_t GetLengthByteSize() const
Get the size in bytes of the length field in the header.
std::shared_ptr< DWARFUnit > m_dwo
std::optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
bool ContainsDIEOffset(dw_offset_t die_offset) const
std::unique_ptr< DWARFDebugAranges > m_func_aranges_up
DWARFUnit & GetNonSkeletonUnit()
DWARFDIE GetDIE(dw_offset_t die_offset)
die_iterator_range dies()
const DWARFAbbreviationDeclarationSet * GetAbbreviations() const
lldb::ByteOrder GetByteOrder() const
void AddUnitDIE(const DWARFDebugInfoEntry &cu_die)
dw_offset_t m_line_table_offset
Value of DW_AT_stmt_list.
const DWARFAbbreviationDeclarationSet * m_abbrevs
uint32_t GetLength() const
DWARFProducer GetProducer()
const lldb_private::FileSpec & GetCompilationDirectory()
std::optional< uint64_t > GetDWOId()
dw_addr_t GetBaseAddress() const
std::optional< lldb_private::FileSpec > m_comp_dir
dw_addr_t m_ranges_base
Value of DW_AT_rnglists_base.
bool HasAny(llvm::ArrayRef< dw_tag_t > tags)
Returns true if any DIEs in the unit match any DW_TAG values in tags.
llvm::Expected< DWARFRangeList > FindRnglistFromOffset(dw_offset_t offset)
Return a list of address ranges resulting from a (possibly encoded) range list starting at a given of...
std::optional< llvm::DWARFListTableHeader > m_loclist_table_header
lldb_private::DWARFDataExtractor GetRnglistData() const
lldb_private::FileSpec GetFile(size_t file_idx)
llvm::sys::RWMutex m_first_die_mutex
dw_offset_t GetOffset() const
lldb_private::DWARFContext & GetDWARFContext()
const DWARFDataExtractor & getOrLoadLocListsData()
llvm::sys::path::Style Style
A stream class that can stream formatted output to a file.
#define DW_INVALID_OFFSET
ByteOrder
Byte ordering definitions.
A mix in class that contains a generic user ID.