LLDB mainline
|
A section + offset based address range class. More...
#include "lldb/Core/AddressRange.h"
Public Member Functions | |
AddressRange () | |
Default constructor. | |
AddressRange (const lldb::SectionSP §ion, lldb::addr_t offset, lldb::addr_t byte_size) | |
Construct with a section pointer, offset, and byte_size. | |
AddressRange (lldb::addr_t file_addr, lldb::addr_t byte_size, const SectionList *section_list=nullptr) | |
Construct with a virtual address, section list and byte size. | |
AddressRange (const Address &so_addr, lldb::addr_t byte_size) | |
Construct with a Address object address and byte size. | |
~AddressRange () | |
Destructor. | |
void | Clear () |
Clear the object's state. | |
bool | IsValid () const |
bool | Contains (const Address &so_addr) const |
Check if a section offset address is contained in this range. | |
bool | ContainsFileAddress (const Address &so_addr) const |
Check if a section offset address is contained in this range. | |
bool | ContainsFileAddress (lldb::addr_t file_addr) const |
Check if the resolved file address file_addr is contained within this object's file address range. | |
bool | ContainsLoadAddress (const Address &so_addr, Target *target) const |
Check if a section offset so_addr when represented as a load address is contained within this object's load address range. | |
bool | ContainsLoadAddress (lldb::addr_t load_addr, Target *target) const |
Check if the resolved load address load_addr is contained within this object's load address range. | |
bool | Extend (const AddressRange &rhs_range) |
Extends this range with rhs_range if it overlaps this range on the right side. | |
bool | Dump (Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style=Address::DumpStyleInvalid) const |
Dump a description of this object to a Stream. | |
void | DumpDebug (Stream *s) const |
Dump a debug description of this object to a Stream. | |
Address & | GetBaseAddress () |
Get accessor for the base address of the range. | |
const Address & | GetBaseAddress () const |
Get const accessor for the base address of the range. | |
lldb::addr_t | GetByteSize () const |
Get accessor for the byte size of this range. | |
size_t | MemorySize () const |
Get the memory cost of this object. | |
void | SetByteSize (lldb::addr_t byte_size) |
Set accessor for the byte size of this range. | |
bool | GetDescription (Stream *s, Target *target) const |
bool | operator== (const AddressRange &rhs) |
bool | operator!= (const AddressRange &rhs) |
Protected Attributes | |
Address | m_base_addr |
The section offset base address of this range. | |
lldb::addr_t | m_byte_size = 0 |
The size in bytes of this address range. | |
A section + offset based address range class.
Definition at line 25 of file AddressRange.h.
AddressRange::AddressRange | ( | ) |
Default constructor.
Initialize with a invalid section (NULL), an invalid offset (LLDB_INVALID_ADDRESS), and zero byte size.
Definition at line 32 of file AddressRange.cpp.
Referenced by MemorySize().
AddressRange::AddressRange | ( | const lldb::SectionSP & | section, |
lldb::addr_t | offset, | ||
lldb::addr_t | byte_size | ||
) |
Construct with a section pointer, offset, and byte_size.
Initialize the address with the supplied section, offset and byte_size.
[in] | section | A section pointer to a valid lldb::Section, or NULL if the address doesn't have a section or will get resolved later. |
[in] | offset | The offset in bytes into section. |
[in] | byte_size | The size in bytes of the address range. |
Definition at line 38 of file AddressRange.cpp.
AddressRange::AddressRange | ( | lldb::addr_t | file_addr, |
lldb::addr_t | byte_size, | ||
const SectionList * | section_list = nullptr |
||
) |
Construct with a virtual address, section list and byte size.
Initialize and resolve the address with the supplied virtual address file_addr, and byte size byte_size.
[in] | file_addr | A virtual address. |
[in] | byte_size | The size in bytes of the address range. |
[in] | section_list | A list of sections, one of which may contain the vaddr. |
Definition at line 34 of file AddressRange.cpp.
AddressRange::AddressRange | ( | const Address & | so_addr, |
lldb::addr_t | byte_size | ||
) |
Construct with a Address object address and byte size.
Initialize by copying the section offset address in so_addr, and setting the byte size to byte_size.
[in] | so_addr | A section offset address object. |
[in] | byte_size | The size in bytes of the address range. |
Definition at line 42 of file AddressRange.cpp.
|
default |
Destructor.
The destructor is virtual in case this class is subclassed.
void AddressRange::Clear | ( | ) |
Clear the object's state.
Sets the section to an invalid value (NULL), an invalid offset (LLDB_INVALID_ADDRESS) and a zero byte size.
Definition at line 144 of file AddressRange.cpp.
References lldb_private::Address::Clear(), m_base_addr, and m_byte_size.
Referenced by lldb::SBAddressRange::Clear(), lldb_private::LineEntry::Clear(), lldb_private::Symbol::Clear(), lldb_private::UnwindPlan::Clear(), PECallFrameInfo::GetAddressRange(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::Block::GetRangeContainingAddress(), and lldb_private::Address::ResolveFunctionScope().
bool AddressRange::Contains | ( | const Address & | so_addr | ) | const |
Check if a section offset address is contained in this range.
[in] | so_addr | A section offset address object reference. |
Definition at line 47 of file AddressRange.cpp.
References ContainsFileAddress(), GetBaseAddress(), and lldb_private::Address::GetSection().
Referenced by CalculateSymbolContext().
bool AddressRange::ContainsFileAddress | ( | const Address & | so_addr | ) | const |
Check if a section offset address is contained in this range.
[in] | so_addr_ptr | A section offset address object pointer. |
[in] | so_addr | A section offset address object reference. |
Definition at line 63 of file AddressRange.cpp.
References GetBaseAddress(), GetByteSize(), lldb_private::Address::GetFileAddress(), lldb_private::Address::GetOffset(), lldb_private::Address::GetSection(), LLDB_INVALID_ADDRESS, and m_base_addr.
Referenced by lldb_private::Process::AdvanceAddressToNextBranchInstruction(), Contains(), lldb_private::FuncUnwinders::ContainsAddress(), lldb_private::Symbol::ContainsFileAddress(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), Extend(), UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::UnwindPlan::PlanValidAtAddress(), lldb_private::Disassembler::PrintInstructions(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().
bool AddressRange::ContainsFileAddress | ( | lldb::addr_t | file_addr | ) | const |
Check if the resolved file address file_addr is contained within this object's file address range.
[in] | file_addr | A section offset address object reference. |
Definition at line 80 of file AddressRange.cpp.
References GetBaseAddress(), GetByteSize(), lldb_private::Address::GetFileAddress(), and LLDB_INVALID_ADDRESS.
Check if a section offset so_addr when represented as a load address is contained within this object's load address range.
[in] | so_addr | A section offset address object reference. |
Definition at line 94 of file AddressRange.cpp.
References GetBaseAddress(), GetByteSize(), lldb_private::Address::GetLoadAddress(), lldb_private::Address::GetOffset(), lldb_private::Address::GetSection(), LLDB_INVALID_ADDRESS, and m_base_addr.
Referenced by CommandObjectThreadUntil::DoExecute(), lldb_private::ThreadPlanStepRange::InSymbol(), lldb::SBThread::StepOverUntil(), and DisassemblerLLVMC::SymbolLookup().
bool AddressRange::ContainsLoadAddress | ( | lldb::addr_t | load_addr, |
Target * | target | ||
) | const |
Check if the resolved load address load_addr is contained within this object's load address range.
Definition at line 112 of file AddressRange.cpp.
References GetBaseAddress(), GetByteSize(), lldb_private::Address::GetLoadAddress(), and LLDB_INVALID_ADDRESS.
bool AddressRange::Dump | ( | Stream * | s, |
Target * | target, | ||
Address::DumpStyle | style, | ||
Address::DumpStyle | fallback_style = Address::DumpStyleInvalid |
||
) | const |
Dump a description of this object to a Stream.
Dump a description of the contents of this object to the supplied stream s. There are many ways to display a section offset based address range, and style lets the user choose how the base address gets displayed.
[in] | s | The stream to which to dump the object description. |
[in] | style | The display style for the address. |
Definition at line 153 of file AddressRange.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::Address::Dump(), Dump(), lldb_private::DumpAddress(), lldb_private::DumpAddressRange(), lldb_private::Address::DumpStyleFileAddress, lldb_private::Address::DumpStyleInvalid, lldb_private::Address::DumpStyleLoadAddress, lldb_private::Address::DumpStyleModuleWithFileAddress, lldb_private::Address::DumpStyleSectionNameOffset, lldb_private::Address::DumpStyleSectionPointerOffset, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), GetBaseAddress(), GetByteSize(), lldb_private::Address::GetFileAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::Address::GetOffset(), LLDB_INVALID_ADDRESS, m_base_addr, lldb_private::Stream::Printf(), and lldb_private::Stream::PutChar().
Referenced by lldb_private::CommandObjectDisassemble::CheckRangeSize(), lldb_private::UnwindPlan::Dump(), lldb_private::SymbolContext::Dump(), Dump(), lldb_private::LineEntry::Dump(), lldb_private::LineEntry::GetDescription(), lldb_private::Function::GetDescription(), and lldb_private::Symbol::GetDescription().
void AddressRange::DumpDebug | ( | Stream * | s | ) | const |
Dump a debug description of this object to a Stream.
Dump a debug description of the contents of this object to the supplied stream s.
The debug description contains verbose internal state such and pointer values, reference counts, etc.
[in] | s | The stream to which to dump the object description. |
Definition at line 204 of file AddressRange.cpp.
References GetByteSize(), lldb_private::Address::GetOffset(), lldb_private::Address::GetSection(), m_base_addr, and lldb_private::Stream::Printf().
bool AddressRange::Extend | ( | const AddressRange & | rhs_range | ) |
Extends this range with rhs_range if it overlaps this range on the right side.
The range overlaps on the right side if the base address of rhs_range lies within this range or if it's contiguous on its right side.
[in] | rhs_range | The range to extend at the right side. |
Definition at line 126 of file AddressRange.cpp.
References ContainsFileAddress(), GetBaseAddress(), GetByteSize(), lldb_private::Address::GetFileAddress(), and m_byte_size.
Referenced by lldb_private::LineEntry::GetSameLineContiguousAddressRange().
|
inline |
Get accessor for the base address of the range.
Definition at line 211 of file AddressRange.h.
References m_base_addr.
Referenced by lldb_private::BreakpointResolver::AddLocation(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::Block::AddRange(), lldb_private::DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(), DynamicLoaderPOSIXDYLD::AlwaysRelyOnEHUnwindInfo(), AppendInstructionToFunctionCallForest(), UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(), lldb_private::x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(), SystemRuntimeMacOSX::BacktraceRecordingHeadersInitialized(), lldb_private::Function::CalculateSymbolContextModule(), lldb_private::LineEntry::Compare(), Contains(), ContainsFileAddress(), ContainsLoadAddress(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::npdb::SymbolFileNativePDB::CreateBlock(), lldb_private::npdb::SymbolFileNativePDB::CreateFunction(), lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), lldb_private::Symbol::Decode(), lldb_private::Disassembler::Disassemble(), lldb_private::Disassembler::DisassembleRange(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::UnwindPlan::Dump(), lldb_private::Function::Dump(), Dump(), lldb_private::LineEntry::Dump(), lldb_private::Symbol::Dump(), DumpAddressOffsetFromFunction(), CommandObjectSourceInfo::DumpLinesInFunctions(), lldb_private::Variable::DumpLocations(), lldb_private::SymbolContext::DumpStopContext(), DumpSymbolContextList(), lldb_private::Symbol::Encode(), Extend(), lldb_private::Module::FindAddressesForLine(), lldb_private::Module::FindFunctions(), lldb_private::Process::FindInMemory(), lldb_private::Process::FindRangesInMemory(), PECallFrameInfo::FindRuntimeFunctionIntersectsWithRange(), UnwindAssembly_x86::FirstNonPrologueInsn(), lldb_private::FormatEntity::Format(), lldb_private::StringSummaryFormat::FormatObject(), lldb_private::Function::Function(), lldb_private::SearchFilter::FunctionPasses(), lldb_private::Symbol::GetAddress(), lldb_private::UnwindTable::GetAddressRange(), PECallFrameInfo::GetAddressRange(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::Symbol::GetAddressRef(), lldb_private::FuncUnwinders::GetArmUnwindUnwindPlan(), lldb_private::ArchitectureMips::GetBreakableLoadAddress(), lldb_private::FuncUnwinders::GetCompactUnwindUnwindPlan(), lldb_private::FuncUnwinders::GetDebugFrameUnwindPlan(), lldb::SBBlock::GetDescription(), lldb_private::Block::GetDescription(), lldb_private::LineEntry::GetDescription(), lldb_private::Symbol::GetDescription(), lldb_private::FuncUnwinders::GetEHFrameUnwindPlan(), UnwindAssembly_x86::GetFastUnwindPlan(), lldb_private::DWARFCallFrameInfo::GetFirstFDEEntryInRange(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::FuncUnwinders::GetFunctionStartAddress(), lldb_private::SymbolContext::GetFunctionStartLineEntry(), lldb_private::Symbol::GetInstructions(), lldb::SBFunction::GetInstructions(), lldb_private::Symbol::GetIntegerValue(), lldb_private::CallEdge::GetLoadAddress(), UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(), UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::FuncUnwinders::GetObjectFileUnwindPlan(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Symbol::GetPrologueByteSize(), lldb_private::Block::GetRangeAtIndex(), lldb_private::Block::GetRangeContainingAddress(), lldb::SBBlock::GetRangeEndAddress(), lldb_private::Block::GetRangeIndexContainingAddress(), lldb_private::Block::GetRanges(), lldb::SBBlock::GetRangeStartAddress(), lldb_private::Symbol::GetRawValue(), lldb_private::Symbol::GetReExportedSymbolName(), lldb_private::LineEntry::GetSameLineContiguousAddressRange(), lldb::SBLineEntry::GetSameLineContiguousAddressRangeEnd(), lldb::SBFunction::GetStartAddress(), lldb_private::Block::GetStartAddress(), DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(), lldb_private::StopInfoTrace::GetSuggestedStackFrameIndex(), lldb_private::FuncUnwinders::GetSymbolFileUnwindPlan(), lldb_private::DWARFCallFrameInfo::GetUnwindPlan(), lldb_private::StackFrame::GuessValueForAddress(), lldb_private::StackFrame::GuessValueForRegisterAndOffset(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::ThreadPlanStepRange::InRange(), lldb_private::LineEntry::IsValid(), line_entry_helper(), lldb_private::Variable::LocationIsValidForAddress(), lldb_private::Variable::LocationIsValidForFrame(), lldb_private::DWARFExpressionList::MatchesOperand(), operator==(), lldb_private::Symbol::operator==(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(), SymbolFileSymtab::ParseFunctions(), lldb_private::npdb::SymbolFileNativePDB::ParseLineTable(), SymbolFilePDB::ParseVariableForPDBData(), lldb_private::UnwindPlan::PlanValidAtAddress(), lldb_private::RegisterContextUnwind::PropagateTrapHandlerFlagFromUnwindPlan(), RemoveFunctionsWithModuleNotEqualTo(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunction(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::Module::ResolveSymbolContextForAddress(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::UnwindPlan::SetPlanValidAddressRange(), lldb_private::BreakpointLocation::SetPreferredLineEntry(), lldb_private::Symbol::SetReExportedSymbolName(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::ThreadPlanStepInRange::ShouldStop(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), DisassemblerLLVMC::SymbolLookup(), lldb_private::ValueObjectVariable::UpdateValue(), and lldb_private::Symbol::ValueIsAddress().
|
inline |
Get const accessor for the base address of the range.
Definition at line 217 of file AddressRange.h.
References m_base_addr.
|
inline |
Get accessor for the byte size of this range.
Definition at line 223 of file AddressRange.h.
References m_byte_size.
Referenced by UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(), lldb_private::CommandObjectDisassemble::CheckRangeSize(), lldb_private::LineEntry::Compare(), ContainsFileAddress(), ContainsLoadAddress(), lldb_private::Disassembler::Disassemble(), lldb_private::Disassembler::DisassembleRange(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::UnwindPlan::Dump(), Dump(), lldb_private::Symbol::Dump(), DumpDebug(), CommandObjectSourceInfo::DumpLinesInFunctions(), lldb_private::Symbol::Encode(), Extend(), lldb_private::Process::FindInMemory(), lldb_private::Process::FindRangesInMemory(), PECallFrameInfo::FindRuntimeFunctionIntersectsWithRange(), UnwindAssembly_x86::FirstNonPrologueInsn(), lldb_private::FormatEntity::Format(), lldb_private::FuncUnwinders::GetAssemblyUnwindPlan(), lldb::SBAddressRange::GetByteSize(), lldb_private::Symbol::GetByteSize(), GetDescription(), lldb_private::DWARFCallFrameInfo::GetFirstFDEEntryInRange(), UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(), UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Symbol::GetPrologueByteSize(), lldb_private::Block::GetRangeContainingAddress(), lldb::SBBlock::GetRangeEndAddress(), lldb_private::Block::GetRangeIndexContainingAddress(), lldb_private::Symbol::GetReExportedSymbolSharedLibrary(), lldb_private::LineEntry::GetSameLineContiguousAddressRange(), lldb::SBLineEntry::GetSameLineContiguousAddressRangeEnd(), lldb_private::Symbol::GetSiblingIndex(), lldb_private::StackFrame::GuessValueForRegisterAndOffset(), lldb_private::x86AssemblyInspectionEngine::local_branch_p(), operator==(), lldb_private::Symbol::operator==(), SymbolFilePDB::ParseVariableForPDBData(), lldb_private::UnwindPlan::PlanValidAtAddress(), lldb_private::Module::ResolveSymbolContextForAddress(), lldb_private::UnwindPlan::SetPlanValidAddressRange(), and lldb_private::ThreadPlanStepOut::ThreadPlanStepOut().
Definition at line 212 of file AddressRange.cpp.
References GetByteSize(), lldb_private::Address::GetFileAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::Address::GetSection(), LLDB_INVALID_ADDRESS, m_base_addr, and lldb_private::Stream::Printf().
Referenced by lldb::SBAddressRange::GetDescription().
bool AddressRange::IsValid | ( | ) | const |
Definition at line 149 of file AddressRange.cpp.
References lldb_private::Address::IsValid(), m_base_addr, and m_byte_size.
Referenced by lldb_private::Process::FindInMemory(), lldb_private::Process::FindRangesInMemory(), lldb::SBAddressRange::IsValid(), and operator==().
|
inline |
Get the memory cost of this object.
Definition at line 229 of file AddressRange.h.
References AddressRange().
bool AddressRange::operator!= | ( | const AddressRange & | rhs | ) |
Definition at line 246 of file AddressRange.cpp.
bool AddressRange::operator== | ( | const AddressRange & | rhs | ) |
Definition at line 239 of file AddressRange.cpp.
References GetBaseAddress(), GetByteSize(), IsValid(), m_base_addr, and m_byte_size.
|
inline |
Set accessor for the byte size of this range.
[in] | byte_size | The new size in bytes of this address range. |
Definition at line 239 of file AddressRange.h.
References m_byte_size.
Referenced by lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::Symbol::Decode(), lldb_private::Disassembler::Disassemble(), lldb_private::DWARFCallFrameInfo::FDEToUnwindPlan(), PECallFrameInfo::GetAddressRange(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::FuncUnwinders::GetAssemblyUnwindPlan(), lldb_private::Block::GetRangeAtIndex(), lldb_private::Block::GetRangeContainingAddress(), lldb_private::StackFrame::GuessValueForAddress(), SymbolFileSymtab::ParseFunctions(), lldb_private::Symbol::SetByteSize(), and lldb_private::Symbol::SetReExportedSymbolSharedLibrary().
|
protected |
The section offset base address of this range.
Definition at line 249 of file AddressRange.h.
Referenced by Clear(), ContainsFileAddress(), ContainsLoadAddress(), Dump(), DumpDebug(), GetBaseAddress(), GetDescription(), IsValid(), and operator==().
|
protected |
The size in bytes of this address range.
Definition at line 250 of file AddressRange.h.
Referenced by Clear(), Extend(), GetByteSize(), IsValid(), operator==(), and SetByteSize().