LLVM  3.7.0
Classes | Public Member Functions | Protected Member Functions | List of all members
llvm::DWARFUnit Class Reference

#include <DWARFUnit.h>

Inheritance diagram for llvm::DWARFUnit:
[legend]

Public Member Functions

 DWARFUnit (DWARFContext &Context, const DWARFSection &Section, const DWARFDebugAbbrev *DA, StringRef RS, StringRef SS, StringRef SOS, StringRef AOS, bool LE, const DWARFUnitSectionBase &UnitSection)
 
virtual ~DWARFUnit ()
 
DWARFContextgetContext () const
 
StringRef getStringSection () const
 
StringRef getStringOffsetSection () const
 
void setAddrOffsetSection (StringRef AOS, uint32_t Base)
 
void setRangesSection (StringRef RS, uint32_t Base)
 
bool getAddrOffsetSectionItem (uint32_t Index, uint64_t &Result) const
 
bool getStringOffsetSectionItem (uint32_t Index, uint32_t &Result) const
 
DataExtractor getDebugInfoExtractor () const
 
DataExtractor getStringExtractor () const
 
const RelocAddrMapgetRelocMap () const
 
bool extract (DataExtractor debug_info, uint32_t *offset_ptr)
 
bool extractRangeList (uint32_t RangeListOffset, DWARFDebugRangeList &RangeList) const
 extractRangeList - extracts the range list referenced by this compile unit from .debug_ranges section. More...
 
void clear ()
 
uint32_t getOffset () const
 
uint32_t getNextUnitOffset () const
 
uint32_t getLength () const
 
uint16_t getVersion () const
 
const
DWARFAbbreviationDeclarationSet
getAbbreviations () const
 
uint8_t getAddressByteSize () const
 
uint64_t getBaseAddress () const
 
void setBaseAddress (uint64_t base_addr)
 
const DWARFDebugInfoEntryMinimalgetUnitDIE (bool ExtractUnitDIEOnly=true)
 
const char * getCompilationDir ()
 
uint64_t getDWOId ()
 
void collectAddressRanges (DWARFAddressRangesVector &CURanges)
 
DWARFDebugInfoEntryInlinedChain getInlinedChainForAddress (uint64_t Address)
 getInlinedChainForAddress - fetches inlined chain for a given address. More...
 
const DWARFUnitSectionBasegetUnitSection () const
 getUnitSection - Return the DWARFUnitSection containing this unit. More...
 
unsigned getNumDIEs ()
 Returns the number of DIEs in the unit. More...
 
uint32_t getDIEIndex (const DWARFDebugInfoEntryMinimal *DIE)
 Return the index of a DIE inside the unit's DIE vector. More...
 
const DWARFDebugInfoEntryMinimalgetDIEAtIndex (unsigned Index) const
 Return the DIE object at the given index. More...
 
const DWARFDebugInfoEntryMinimalgetDIEForOffset (uint32_t Offset) const
 Return the DIE object for a given offset inside the unit's DIE vector. More...
 

Protected Member Functions

virtual bool extractImpl (DataExtractor debug_info, uint32_t *offset_ptr)
 
virtual uint32_t getHeaderSize () const
 Size in bytes of the unit header. More...
 

Detailed Description

Definition at line 103 of file DWARFUnit.h.

Constructor & Destructor Documentation

DWARFUnit::DWARFUnit ( DWARFContext Context,
const DWARFSection Section,
const DWARFDebugAbbrev DA,
StringRef  RS,
StringRef  SS,
StringRef  SOS,
StringRef  AOS,
bool  LE,
const DWARFUnitSectionBase UnitSection 
)

Definition at line 33 of file DWARFUnit.cpp.

References clear().

DWARFUnit::~DWARFUnit ( )
virtual

Definition at line 43 of file DWARFUnit.cpp.

Member Function Documentation

void DWARFUnit::clear ( )

Definition at line 110 of file DWARFUnit.cpp.

Referenced by DWARFUnit(), and extract().

void DWARFUnit::collectAddressRanges ( DWARFAddressRangesVector CURanges)

Definition at line 309 of file DWARFUnit.cpp.

References getUnitDIE().

bool DWARFUnit::extract ( DataExtractor  debug_info,
uint32_t *  offset_ptr 
)

Definition at line 85 of file DWARFUnit.cpp.

References clear(), extractImpl(), and llvm::DataExtractor::isValidOffset().

bool DWARFUnit::extractImpl ( DataExtractor  debug_info,
uint32_t *  offset_ptr 
)
protectedvirtual
bool DWARFUnit::extractRangeList ( uint32_t  RangeListOffset,
DWARFDebugRangeList RangeList 
) const

extractRangeList - extracts the range list referenced by this compile unit from .debug_ranges section.

Returns true on success. Requires that compile unit is already extracted.

Definition at line 101 of file DWARFUnit.cpp.

References llvm::DWARFDebugRangeList::extract().

Referenced by llvm::DWARFDebugInfoEntryMinimal::getAddressRanges().

const DWARFAbbreviationDeclarationSet* llvm::DWARFUnit::getAbbreviations ( ) const
inline
uint8_t llvm::DWARFUnit::getAddressByteSize ( ) const
inline
bool DWARFUnit::getAddrOffsetSectionItem ( uint32_t  Index,
uint64_t &  Result 
) const
uint64_t llvm::DWARFUnit::getBaseAddress ( ) const
inline

Definition at line 192 of file DWARFUnit.h.

Referenced by llvm::DWARFDebugInfoEntryMinimal::getAddressRanges().

const char * DWARFUnit::getCompilationDir ( )
DWARFContext& llvm::DWARFUnit::getContext ( ) const
inline

Definition at line 150 of file DWARFUnit.h.

Referenced by llvm::DWARFDebugInfoEntryMinimal::dumpAttribute().

DataExtractor llvm::DWARFUnit::getDebugInfoExtractor ( ) const
inline
const DWARFDebugInfoEntryMinimal* llvm::DWARFUnit::getDIEAtIndex ( unsigned  Index) const
inline

Return the DIE object at the given index.

Definition at line 236 of file DWARFUnit.h.

const DWARFDebugInfoEntryMinimal* llvm::DWARFUnit::getDIEForOffset ( uint32_t  Offset) const
inline

Return the DIE object for a given offset inside the unit's DIE vector.

The unit needs to have his DIEs extracted for this method to work.

Definition at line 245 of file DWARFUnit.h.

uint32_t llvm::DWARFUnit::getDIEIndex ( const DWARFDebugInfoEntryMinimal DIE)
inline

Return the index of a DIE inside the unit's DIE vector.

It is illegal to call this method with a DIE that hasn't be created by this unit. In other word, it's illegal to call this method on a DIE that isn't accessible by following children/sibling links starting from this unit's getUnitDIE().

Definition at line 229 of file DWARFUnit.h.

uint64_t DWARFUnit::getDWOId ( )

Definition at line 130 of file DWARFUnit.cpp.

References llvm::dwarf::DW_AT_GNU_dwo_id.

virtual uint32_t llvm::DWARFUnit::getHeaderSize ( ) const
inlineprotectedvirtual

Size in bytes of the unit header.

Reimplemented in llvm::DWARFTypeUnit.

Definition at line 140 of file DWARFUnit.h.

Referenced by llvm::DWARFTypeUnit::getHeaderSize().

DWARFDebugInfoEntryInlinedChain DWARFUnit::getInlinedChainForAddress ( uint64_t  Address)

getInlinedChainForAddress - fetches inlined chain for a given address.

Returns empty chain if there is no subprogram containing address. The chain is valid as long as parsed compile unit DIEs are not cleared.

Definition at line 355 of file DWARFUnit.cpp.

References llvm::DWARFDebugInfoEntryMinimal::getInlinedChainForAddress().

Referenced by getFunctionNameForAddress(), and llvm::DWARFContext::getInliningInfoForAddress().

uint32_t llvm::DWARFUnit::getLength ( ) const
inline
uint32_t llvm::DWARFUnit::getNextUnitOffset ( ) const
inline
unsigned llvm::DWARFUnit::getNumDIEs ( )
inline

Returns the number of DIEs in the unit.

Parses the unit if necessary.

Definition at line 218 of file DWARFUnit.h.

uint32_t llvm::DWARFUnit::getOffset ( ) const
inline
const RelocAddrMap* llvm::DWARFUnit::getRelocMap ( ) const
inline

Definition at line 174 of file DWARFUnit.h.

References llvm::DWARFSection::Relocs.

Referenced by llvm::DWARFFormValue::extractValue().

DataExtractor llvm::DWARFUnit::getStringExtractor ( ) const
inline

Definition at line 170 of file DWARFUnit.h.

Referenced by llvm::DWARFFormValue::getAsCString().

StringRef llvm::DWARFUnit::getStringOffsetSection ( ) const
inline

Definition at line 153 of file DWARFUnit.h.

bool DWARFUnit::getStringOffsetSectionItem ( uint32_t  Index,
uint32_t &  Result 
) const
StringRef llvm::DWARFUnit::getStringSection ( ) const
inline

Definition at line 152 of file DWARFUnit.h.

const DWARFDebugInfoEntryMinimal* llvm::DWARFUnit::getUnitDIE ( bool  ExtractUnitDIEOnly = true)
inline
const DWARFUnitSectionBase& llvm::DWARFUnit::getUnitSection ( ) const
inline

getUnitSection - Return the DWARFUnitSection containing this unit.

Definition at line 214 of file DWARFUnit.h.

Referenced by findUnitAndExtractFast().

uint16_t llvm::DWARFUnit::getVersion ( ) const
inline
void llvm::DWARFUnit::setAddrOffsetSection ( StringRef  AOS,
uint32_t  Base 
)
inline

Definition at line 154 of file DWARFUnit.h.

void llvm::DWARFUnit::setBaseAddress ( uint64_t  base_addr)
inline

Definition at line 194 of file DWARFUnit.h.

void llvm::DWARFUnit::setRangesSection ( StringRef  RS,
uint32_t  Base 
)
inline

Definition at line 158 of file DWARFUnit.h.


The documentation for this class was generated from the following files: