LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lldb_private::Address Class Reference

A section + offset based address class. More...

#include "lldb/Core/Address.h"

Classes

class  ModulePointerAndOffsetLessThanFunctionObject
 

Public Types

enum  DumpStyle {
  DumpStyleInvalid , DumpStyleSectionNameOffset , DumpStyleSectionPointerOffset , DumpStyleFileAddress ,
  DumpStyleModuleWithFileAddress , DumpStyleLoadAddress , DumpStyleResolvedDescription , DumpStyleResolvedDescriptionNoModule ,
  DumpStyleResolvedDescriptionNoFunctionArguments , DumpStyleNoFunctionName , DumpStyleDetailedSymbolContext , DumpStyleResolvedPointerDescription
}
 Dump styles allow the Address::Dump(Stream *,DumpStyle) const function to display Address contents in a variety of ways. More...
 

Public Member Functions

 Address ()=default
 Default constructor.
 
 Address (const Address &rhs)
 Copy constructor.
 
 Address (const lldb::SectionSP &section_sp, lldb::addr_t offset)
 Construct with a section pointer and offset.
 
 Address (lldb::addr_t file_addr, const SectionList *section_list)
 Construct with a virtual address and section list.
 
 Address (lldb::addr_t abs_addr)
 
const Addressoperator= (const Address &rhs)
 Assignment operator.
 
void Clear ()
 Clear the object's state.
 
bool GetDescription (Stream &s, Target &target, lldb::DescriptionLevel level) const
 Write a description of this object to a Stream.
 
bool Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX, bool all_ranges=false, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
 Dump a description of this object to a Stream.
 
AddressClass GetAddressClass () const
 
lldb::addr_t GetFileAddress () const
 Get the file address.
 
lldb::addr_t GetLoadAddress (Target *target) const
 Get the load address.
 
lldb::addr_t GetCallableLoadAddress (Target *target, bool is_indirect=false) const
 Get the load address as a callable code load address.
 
lldb::addr_t GetOpcodeLoadAddress (Target *target, AddressClass addr_class=AddressClass::eInvalid) const
 Get the load address as an opcode load address.
 
lldb::addr_t GetOffset () const
 Get the section relative offset value.
 
bool IsSectionOffset () const
 Check if an address is section offset.
 
bool IsValid () const
 Check if the object state is valid.
 
size_t MemorySize () const
 Get the memory cost of this object.
 
bool ResolveAddressUsingFileSections (lldb::addr_t addr, const SectionList *sections)
 Resolve a file virtual address using a section list.
 
bool ResolveFunctionScope (lldb_private::SymbolContext &sym_ctx, lldb_private::AddressRange *addr_range_ptr=nullptr)
 Resolve this address to its containing function and optionally get that function's address range.
 
bool SetLoadAddress (lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
 Set the address to represent load_addr.
 
bool SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target, AddressClass addr_class=AddressClass::eInvalid, bool allow_section_end=false)
 
bool SetCallableLoadAddress (lldb::addr_t load_addr, Target *target)
 
lldb::ModuleSP GetModule () const
 Get accessor for the module for this address.
 
lldb::SectionSP GetSection () const
 Get const accessor for the section.
 
bool SetOffset (lldb::addr_t offset)
 Set accessor for the offset.
 
void SetRawAddress (lldb::addr_t addr)
 
bool Slide (int64_t offset)
 
void SetSection (const lldb::SectionSP &section_sp)
 Set accessor for the section.
 
void ClearSection ()
 
uint32_t CalculateSymbolContext (SymbolContext *sc, lldb::SymbolContextItem resolve_scope=lldb::eSymbolContextEverything) const
 Reconstruct a symbol context from an address.
 
lldb::ModuleSP CalculateSymbolContextModule () const
 
CompileUnitCalculateSymbolContextCompileUnit () const
 
FunctionCalculateSymbolContextFunction () const
 
BlockCalculateSymbolContextBlock () const
 
SymbolCalculateSymbolContextSymbol () const
 
bool CalculateSymbolContextLineEntry (LineEntry &line_entry) const
 
bool SectionWasDeleted () const
 

Static Public Member Functions

static int CompareFileAddress (const Address &lhs, const Address &rhs)
 Compare two Address objects.
 
static int CompareLoadAddress (const Address &lhs, const Address &rhs, Target *target)
 
static int CompareModulePointerAndOffset (const Address &lhs, const Address &rhs)
 

Protected Member Functions

bool SectionWasDeletedPrivate () const
 

Protected Attributes

lldb::SectionWP m_section_wp
 The section for the address, can be NULL.
 
lldb::addr_t m_offset = LLDB_INVALID_ADDRESS
 Offset into section if m_section_wp is valid...
 

Detailed Description

A section + offset based address class.

The Address class allows addresses to be relative to a section that can move during runtime due to images (executables, shared libraries, bundles, frameworks) being loaded at different addresses than the addresses found in the object file that represents them on disk. There are currently two types of addresses for a section:

File addresses represent the virtual addresses that are in the "on disk" object files. These virtual addresses are converted to be relative to unique sections scoped to the object file so that when/if the addresses slide when the images are loaded/unloaded in memory, we can easily track these changes without having to update every object (compile unit ranges, line tables, function address ranges, lexical block and inlined subroutine address ranges, global and static variables) each time an image is loaded or unloaded.

Load addresses represent the virtual addresses where each section ends up getting loaded at runtime. Before executing a program, it is common for all of the load addresses to be unresolved. When a DynamicLoader plug-in receives notification that shared libraries have been loaded/unloaded, the load addresses of the main executable and any images (shared libraries) will be resolved/unresolved. When this happens, breakpoints that are in one of these sections can be set/cleared.

Definition at line 62 of file Address.h.

Member Enumeration Documentation

◆ DumpStyle

Dump styles allow the Address::Dump(Stream *,DumpStyle) const function to display Address contents in a variety of ways.

Enumerator
DumpStyleInvalid 

Invalid dump style.

DumpStyleSectionNameOffset 

Display as the section name + offset.

// address for printf in libSystem.B.dylib as a section name + offset
libSystem.B.dylib.__TEXT.__text + 0x0005cfdf
DumpStyleSectionPointerOffset 

Display as the section pointer + offset (debug output).

// address for printf in libSystem.B.dylib as a section pointer +
offset (lldb::Section *)0x35cc50 + 0x000000000005cfdf
DumpStyleFileAddress 

Display as the file address (if any).

// address for printf in libSystem.B.dylib as a file address
0x000000000005dcff
DumpStyleModuleWithFileAddress 

Display as the file address with the module name prepended (if any).

// address for printf in libSystem.B.dylib as a file address
libSystem.B.dylib[0x000000000005dcff]
DumpStyleLoadAddress 

Display as the load address (if resolved).

// address for printf in libSystem.B.dylib as a load address
0x00007fff8306bcff
DumpStyleResolvedDescription 

Display the details about what an address resolves to.

This can be anything from a symbol context summary (module, function/symbol, and file and line), to information about what the pointer points to if the address is in a section (section of pointers, c strings, etc).

DumpStyleResolvedDescriptionNoModule 
DumpStyleResolvedDescriptionNoFunctionArguments 
DumpStyleNoFunctionName 

Elide the function name; display an offset into the current function.

Used primarily in disassembly symbolication

DumpStyleDetailedSymbolContext 

Detailed symbol context information for an address for all symbol context members.

DumpStyleResolvedPointerDescription 

Dereference a pointer at the current address and then lookup the dereferenced address using DumpStyleResolvedDescription.

Definition at line 66 of file Address.h.

Constructor & Destructor Documentation

◆ Address() [1/5]

lldb_private::Address::Address ( )
default

Default constructor.

Initialize with a invalid section (NULL) and an invalid offset (LLDB_INVALID_ADDRESS).

Referenced by MemorySize().

◆ Address() [2/5]

lldb_private::Address::Address ( const Address rhs)
inline

Copy constructor.

Makes a copy of the another Address object rhs.

Parameters
[in]rhsA const Address object reference to copy.

Definition at line 130 of file Address.h.

◆ Address() [3/5]

lldb_private::Address::Address ( const lldb::SectionSP section_sp,
lldb::addr_t  offset 
)
inline

Construct with a section pointer and offset.

Initialize the address with the supplied section and offset.

Parameters
[in]section_spA section pointer to a valid lldb::Section, or NULL if the address doesn't have a section or will get resolved later.
[in]offsetThe offset in bytes into section.

Definition at line 143 of file Address.h.

References m_section_wp.

◆ Address() [4/5]

Address::Address ( lldb::addr_t  file_addr,
const SectionList section_list 
)

Construct with a virtual address and section list.

Initialize and resolve the address with the supplied virtual address file_addr.

Parameters
[in]file_addrA virtual file address.
[in]section_listA list of sections, one of which may contain the file_addr.

Definition at line 237 of file Address.cpp.

References ResolveAddressUsingFileSections().

◆ Address() [5/5]

Address::Address ( lldb::addr_t  abs_addr)

Definition at line 235 of file Address.cpp.

Member Function Documentation

◆ CalculateSymbolContext()

uint32_t Address::CalculateSymbolContext ( SymbolContext sc,
lldb::SymbolContextItem  resolve_scope = lldb::eSymbolContextEverything 
) const

◆ CalculateSymbolContextBlock()

Block * Address::CalculateSymbolContextBlock ( ) const

◆ CalculateSymbolContextCompileUnit()

CompileUnit * Address::CalculateSymbolContextCompileUnit ( ) const

◆ CalculateSymbolContextFunction()

Function * Address::CalculateSymbolContextFunction ( ) const

◆ CalculateSymbolContextLineEntry()

bool Address::CalculateSymbolContextLineEntry ( LineEntry line_entry) const

◆ CalculateSymbolContextModule()

ModuleSP Address::CalculateSymbolContextModule ( ) const

Definition at line 850 of file Address.cpp.

References GetSection().

◆ CalculateSymbolContextSymbol()

Symbol * Address::CalculateSymbolContextSymbol ( ) const

◆ Clear()

void lldb_private::Address::Clear ( )
inline

◆ ClearSection()

void lldb_private::Address::ClearSection ( )
inline

Definition at line 477 of file Address.h.

References m_section_wp.

◆ CompareFileAddress()

int Address::CompareFileAddress ( const Address lhs,
const Address rhs 
)
static

Compare two Address objects.

Parameters
[in]lhsThe Left Hand Side const Address object reference.
[in]rhsThe Right Hand Side const Address object reference.
Returns
-1 if lhs < rhs 0 if lhs == rhs 1 if lhs > rhs

Definition at line 931 of file Address.cpp.

References GetFileAddress().

Referenced by lldb_private::LineEntry::Compare().

◆ CompareLoadAddress()

int Address::CompareLoadAddress ( const Address lhs,
const Address rhs,
Target target 
)
static

Definition at line 941 of file Address.cpp.

References GetLoadAddress().

Referenced by lldb_private::UserExpression::LockAndCheckContext().

◆ CompareModulePointerAndOffset()

int Address::CompareModulePointerAndOffset ( const Address lhs,
const Address rhs 
)
static

◆ Dump()

bool Address::Dump ( Stream s,
ExecutionContextScope exe_scope,
DumpStyle  style,
DumpStyle  fallback_style = DumpStyleInvalid,
uint32_t  addr_byte_size = UINT32_MAX,
bool  all_ranges = false,
std::optional< Stream::HighlightSettings settings = std::nullopt 
) 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, and style lets the user choose.

Parameters
[in]sThe stream to which to dump the object description.
[in]styleThe display style for the address.
[in]fallback_styleThe display style for the address.
[in]addr_byte_sizeThe address byte size for the address.
[in]all_rangesIf true, dump all valid ranges and value ranges for the variable that contains the address, otherwise dumping the range that contains the address.
[in]patternAn optional regex pattern to match against the description. If specified, parts of the description matching this pattern may be highlighted or processed differently. If this parameter is an empty string or not provided, no highlighting is applied.
Returns
Returns true if the address was able to be displayed. File and load addresses may be unresolved and it may not be possible to display a valid value, false will be returned in such cases.
See also
Address::DumpStyle

Definition at line 408 of file Address.cpp.

References lldb_private::Block::AppendVariables(), lldb_private::ConstString::AsCString(), lldb_private::Stream::AsRawOstream(), lldb_private::SymbolContext::block, Dump(), lldb_private::DumpAddress(), lldb_private::DumpAddressRange(), lldb_private::SymbolContext::DumpStopContext(), DumpStyleDetailedSymbolContext, DumpStyleFileAddress, DumpStyleInvalid, DumpStyleLoadAddress, DumpStyleModuleWithFileAddress, DumpStyleNoFunctionName, DumpStyleResolvedDescription, DumpStyleResolvedDescriptionNoFunctionArguments, DumpStyleResolvedDescriptionNoModule, DumpStyleResolvedPointerDescription, DumpStyleSectionNameOffset, DumpStyleSectionPointerOffset, DumpUInt(), lldb::eDescriptionLevelBrief, lldb_private::Stream::EOL(), lldb::eSectionTypeData, lldb::eSectionTypeData16, lldb::eSectionTypeData4, lldb::eSectionTypeData8, lldb::eSectionTypeDataCString, lldb::eSectionTypeDataCStringPointers, lldb::eSectionTypeDataObjCCFStrings, lldb::eSectionTypeDataObjCMessageRefs, lldb::eSectionTypeDataPointers, lldb_private::ABI::FindPlugin(), lldb_private::SymbolContext::function, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Symbol::GetAddressRef(), lldb_private::Target::GetArchitecture(), GetCallableLoadAddress(), lldb_private::ConstString::GetCString(), lldb_private::SymbolContext::GetDescription(), GetFileAddress(), lldb_private::Target::GetImages(), GetLoadAddress(), lldb_private::ArchSpec::GetMachine(), GetModule(), lldb_private::Type::GetName(), lldb_private::Symbol::GetName(), GetOffset(), lldb_private::ExecutionContext::GetProcessPtr(), GetSection(), lldb_private::StreamString::GetSize(), lldb_private::StreamString::GetString(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Stream::Indent(), IsSectionOffset(), LLDB_INVALID_ADDRESS, lldb_private::Variable::LocationIsValidForAddress(), m_offset, lldb_private::Stream::Printf(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), lldb_private::Stream::PutCStringColorHighlighted(), ReadAddress(), ReadCStringFromMemory(), lldb_private::Process::ReadPointerFromMemory(), lldb_private::ModuleList::ResolveSymbolContextForAddress(), SetLoadAddress(), SetOffset(), lldb_private::SymbolContext::symbol, UINT32_MAX, lldb_private::Symbol::ValueIsAddress(), and lldb_private::Stream::Write().

Referenced by lldb::SBBreakpoint::AddLocation(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::formatters::CXXFunctionPointerSummaryProvider(), CommandObjectSourceList::DoExecute(), Dump(), lldb_private::AddressRange::Dump(), lldb_private::LineEntry::Dump(), lldb_private::Symbol::Dump(), DumpAddress(), DumpAddressAndContent(), lldb_private::DumpDataExtractor(), CommandObjectRegisterRead::DumpRegister(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::BreakpointResolverAddress::GetDescription(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::ThreadPlanStepOut::GetDescription(), lldb_private::LineEntry::GetDescription(), lldb_private::Symbol::GetDescription(), CommandObjectSourceInfo::GetSymbolContextsForAddress(), lldb_private::CompactUnwindInfo::GetUnwindPlan(), lldb_private::ThreadPlanAssemblyTracer::Log(), lldb_private::UnwindPlan::PlanValidAtAddress(), CommandObjectTargetModulesList::PrintModule(), and DisassemblerLLVMC::SymbolLookup().

◆ GetAddressClass()

AddressClass Address::GetAddressClass ( ) const

◆ GetCallableLoadAddress()

addr_t Address::GetCallableLoadAddress ( Target target,
bool  is_indirect = false 
) const

Get the load address as a callable code load address.

This function will first resolve its address to a load address. Then, if the address turns out to be in code address, return the load address that would be required to call or return to. The address might have extra bits set (bit zero will be set to Thumb functions for an ARM target) that are required when changing the program counter to setting a return address.

Returns
The valid load virtual address, or LLDB_INVALID_ADDRESS if the address is currently not loaded.

Definition at line 338 of file Address.cpp.

References error(), GetAddressClass(), lldb_private::Target::GetCallableLoadAddress(), GetLoadAddress(), lldb_private::Target::GetProcessSP(), and LLDB_INVALID_ADDRESS.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), CommandObjectThreadJump::DoExecute(), Dump(), lldb_private::ClangExpressionDeclMap::GetSymbolAddress(), line_entry_helper(), ABIMacOSX_arm::PrepareTrivialCall(), ABISysV_arm::PrepareTrivialCall(), lldb_private::Symbol::ResolveCallableAddress(), lldb_private::RegisterContext::SetPC(), and lldb_private::FunctionCaller::WriteFunctionArguments().

◆ GetDescription()

bool Address::GetDescription ( Stream s,
Target target,
lldb::DescriptionLevel  level 
) const

◆ GetFileAddress()

addr_t Address::GetFileAddress ( ) const

Get the file address.

If an address comes from a file on disk that has section relative addresses, then it has a virtual address that is relative to unique section in the object file.

Returns
The valid file virtual address, or LLDB_INVALID_ADDRESS if the address doesn't have a file virtual address (image is from memory only with no representation on disk).

Definition at line 293 of file Address.cpp.

References GetSection(), LLDB_INVALID_ADDRESS, m_offset, and SectionWasDeletedPrivate().

Referenced by lldb_private::BreakpointResolver::AddLocation(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::Block::AddRange(), ObjectFilePECOFF::AppendFromCOFFSymbolTable(), ApplyELF32ABS32RelRelocation(), ApplyELF64ABS32Relocation(), ApplyELF64ABS64Relocation(), ObjectFileELF::ApplyRelocations(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), InstructionLLVMC::CalculateMnemonicOperandsAndComment(), CompareFileAddress(), CompareModulePointerAndOffset(), DynamicLoaderPOSIXDYLD::ComputeLoadOffset(), lldb_private::AddressRange::ContainsFileAddress(), lldb_private::npdb::SymbolFileNativePDB::CreateBlock(), lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), InstructionLLVMC::Decode(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), lldb_private::Function::Dump(), Dump(), lldb_private::AddressRange::Dump(), DumpAddressAndContent(), DumpAddressOffsetFromFunction(), CommandObjectSourceInfo::DumpLinesInFunctions(), lldb_private::Variable::DumpLocations(), lldb_private::Symbol::Encode(), lldb_private::AddressRange::Extend(), lldb_private::DWARFCallFrameInfo::FDEToUnwindPlan(), lldb_private::Module::FindFunctions(), DynamicLoaderFreeBSDKernel::FindKernelAtLoadAddress(), lldb_private::LineTable::FindLineEntryByAddress(), fixupExternalAddrZeroVariable(), GetAddressClass(), lldb_private::DWARFCallFrameInfo::GetAddressRange(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::ArchitectureMips::GetBreakableLoadAddress(), lldb_private::ArchitecturePPC64::GetBytesToSkip(), lldb_private::CompactUnwindInfo::GetCompactUnwindInfoForFunction(), SymbolFilePDB::GetCompileUnitContainsAddress(), lldb::SBBlock::GetDescription(), lldb_private::Block::GetDescription(), DynamicLoaderHexagonDYLD::GetEntryPoint(), ObjectFileMachO::GetEntryPointAddress(), lldb_private::ArmUnwindInfo::GetExceptionHandlingTableEntry(), lldb_private::Symbol::GetFileAddress(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(), lldb_private::DWARFCallFrameInfo::GetFirstFDEEntryInRange(), lldb_private::UnwindTable::GetFuncUnwindersContainingAddress(), UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::breakpad::SymbolFileBreakpad::GetParameterStackSize(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Symbol::GetRawValue(), ObjectFilePECOFF::GetRVA(), lldb_private::breakpad::SymbolFileBreakpad::GetUnwindPlan(), lldb_private::CompactUnwindInfo::GetUnwindPlan(), lldb_private::StackFrame::GuessValueForRegisterAndOffset(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::InitOSO(), lldb_private::Variable::IsInScope(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::LinkOSOAddress(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(), DynamicLoaderFreeBSDKernel::KModImageInfo::LoadImageUsingMemoryModule(), DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded(), lldb_private::Variable::LocationIsValidForAddress(), lldb_private::DWARFExpressionList::MatchesOperand(), EntitySymbol::Materialize(), lldb_private::operator<(), lldb_private::operator>(), lldb_private::npdb::SymbolFileNativePDB::ParseInlineSite(), ObjectFileMachO::ParseSymtab(), SymbolFilePDB::ParseVariableForPDBData(), CommandObjectTargetModulesList::PrintModule(), DynamicLoaderDarwinKernel::PutToLog(), DynamicLoaderDarwinKernel::ReadKextSummaryHeader(), DynamicLoaderFreeBSDKernel::ReadKmodsListHeader(), lldb_private::Target::ReadMemory(), LoadAddressResolver::Resolve(), lldb_private::SymbolFileCTF::ResolveSymbolContext(), lldb_private::SymbolFileJSON::ResolveSymbolContext(), SymbolFileSymtab::ResolveSymbolContext(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::Module::ResolveSymbolContextForAddress(), lldb_private::AddressResolverFileLine::SearchCallback(), DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(), lldb_private::EmulateInstruction::SetInstruction(), ObjectFileELF::SetLoadAddress(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::ValueObjectMemory::ValueObjectMemory(), and InstructionLLVMC::VisitInstruction().

◆ GetLoadAddress()

addr_t Address::GetLoadAddress ( Target target) const

Get the load address.

If an address comes from a file on disk that has section relative addresses, then it has a virtual address that is relative to unique section in the object file. Sections get resolved at runtime by DynamicLoader plug-ins as images (executables and shared libraries) get loaded/unloaded. If a section is loaded, then the load address can be resolved.

Returns
The valid load virtual address, or LLDB_INVALID_ADDRESS if the address is currently not loaded.

Definition at line 313 of file Address.cpp.

References GetSection(), LLDB_INVALID_ADDRESS, m_offset, and SectionWasDeletedPrivate().

Referenced by lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), SystemRuntimeMacOSX::BacktraceRecordingHeadersInitialized(), BuildModulesSection(), InstructionLLVMC::CalculateMnemonicOperandsAndComment(), CompareLoadAddress(), lldb_private::ThreadPlanCallFunction::ConstructorSetup(), lldb_private::AddressRange::ContainsLoadAddress(), lldb_private::Value::ConvertToLoadAddress(), CreateAllImageInfosPayload(), lldb_private::CompactUnwindInfo::CreateUnwindPlan_i386(), lldb_private::CompactUnwindInfo::CreateUnwindPlan_x86_64(), DescribeAddressBriefly(), lldb_private::StopInfoMachException::DeterminePtrauthFailure(), DynamicLoaderPOSIXDYLD::DidAttach(), lldb_private::HistoryUnwind::DoCreateRegisterContextForFrame(), CommandObjectTargetModulesLoad::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::UnwindPlan::Dump(), Dump(), lldb_private::AddressRange::Dump(), DumpAddressAndContent(), DumpAddressOffsetFromFunction(), CommandObjectSourceInfo::DumpLinesInFunctions(), ExtractRuntimeGlobalSymbol(), HexagonDYLDRendezvous::FindMetadata(), findSymbolAddress(), lldb_private::ArchitectureMips::GetBreakableLoadAddress(), GetCallableLoadAddress(), lldb_private::Block::GetDescription(), lldb_private::ThreadPlanCallFunction::GetDescription(), lldb_private::ThreadPlanCallFunctionUsingABI::GetDescription(), lldb_private::ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::RegisterContextUnwind::GetFullUnwindPlanForFrame(), ProcessElfCore::GetImageInfoAddress(), lldb_private::ProcessWindows::GetImageInfoAddress(), lldb_private::AppleObjCRuntimeV1::GetISAHashTablePointer(), lldb::SBValue::GetLoadAddress(), lldb_private::CallEdge::GetLoadAddress(), lldb_private::Symbol::GetLoadAddress(), GetOpcodeLoadAddress(), lldb_private::Target::GetReasonableReadSize(), lldb_private::RegisterContextUnwind::GetStartPC(), DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(), JITLoaderGDB::GetSymbolAddress(), lldb_private::ClangExpressionDeclMap::GetSymbolAddress(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::Value::GetValueAsData(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::ThreadPlanStepRange::InRange(), DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded(), lldb_private::Variable::LocationIsValidForFrame(), EntitySymbol::Materialize(), CommandObjectTargetModulesList::PrintModule(), lldb_private::RegisterContextUnwind::PropagateTrapHandlerFlagFromUnwindPlan(), DynamicLoaderFreeBSDKernel::ReadAllKmods(), lldb_private::Target::ReadCStringFromMemory(), DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback(), DynamicLoaderFreeBSDKernel::ReadKmodsListHeader(), lldb_private::Target::ReadMemory(), LoadAddressResolver::Resolve(), lldb_private::Process::ResolveIndirectFunction(), ResolveLoadAddress(), DYLDRendezvous::ResolveRendezvousAddress(), lldb_private::InstrumentationRuntimeMainThreadChecker::RetrieveReportData(), lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(), lldb_private::RegisterContextUnwind::SavedLocationForRegister(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::EmulateInstruction::SetInstruction(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::Watchpoint::SetupVariableWatchpointDisabler(), lldb_private::ThreadPlanStepInRange::ShouldStop(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::CFBasicHash::UpdateFor(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), and lldb_private::ValueObjectMemory::ValueObjectMemory().

◆ GetModule()

ModuleSP Address::GetModule ( ) const

Get accessor for the module for this address.

Returns
Returns the Module pointer that this address is an offset in, or NULL if this address doesn't belong in a module, or isn't resolved yet.

Definition at line 285 of file Address.cpp.

References GetSection().

Referenced by lldb_private::DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(), DynamicLoaderPOSIXDYLD::AlwaysRelyOnEHUnwindInfo(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), lldb_private::Symbol::CalculateSymbolContext(), lldb_private::Symbol::CalculateSymbolContextModule(), CompareModulePointerAndOffset(), CommandObjectSourceList::DoExecute(), CommandObjectTargetModulesList::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), Dump(), lldb_private::LineTable::FindLineEntryByAddress(), GetAddressClass(), lldb_private::DWARFCallFrameInfo::GetAddressRange(), lldb_private::ArchitectureMips::GetBreakableLoadAddress(), GetByteOrderAndAddressSize(), lldb::SBInstruction::GetDescription(), lldb::SBInstructionList::GetDescription(), lldb_private::RegisterContextUnwind::GetFastUnwindPlanForFrame(), lldb_private::InstrumentationRuntimeTSan::GetFirstNonInternalFramePc(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::RegisterContextUnwind::GetFullUnwindPlanForFrame(), lldb_private::Symbol::GetInstructions(), lldb::SBFunction::GetInstructions(), lldb::SBSymbol::GetInstructions(), lldb_private::CallEdge::GetLoadAddress(), lldb_private::ValueObjectMemory::GetModule(), lldb_private::Symbol::GetPrologueByteSize(), CommandObjectSourceInfo::GetSymbolContextsForAddress(), lldb_private::DWARFCallFrameInfo::GetUnwindPlan(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::LinkOSOAddress(), lldb_private::Variable::LocationIsValidForAddress(), LookupAddressInModule(), lldb_private::DynamicLoaderWindowsDYLD::OnUnloadModule(), lldb_private::operator<(), lldb_private::operator>(), lldb::SBInstruction::Print(), lldb_private::Disassembler::PrintInstructions(), ReadAddress(), lldb_private::Target::ReadMemory(), lldb_private::BreakpointLocationList::RemoveInvalidLocations(), lldb_private::ModuleList::ResolveSymbolContextForAddress(), lldb_private::InstrumentationRuntimeMainThreadChecker::RetrieveReportData(), lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(), lldb_private::StackFrame::StackFrame(), DisassemblerLLVMC::SymbolLookup(), and lldb_private::DynamicLoaderDarwin::UnloadImages().

◆ GetOffset()

lldb::addr_t lldb_private::Address::GetOffset ( ) const
inline

Get the section relative offset value.

Returns
The current offset, or LLDB_INVALID_ADDRESS if this address doesn't contain a valid offset.

Definition at line 329 of file Address.h.

References m_offset.

Referenced by lldb_private::ArchitecturePPC64::AdjustBreakpointAddress(), lldb_private::AddressRange::ContainsFileAddress(), lldb_private::AddressRange::ContainsLoadAddress(), CommandObjectThreadUntil::DoExecute(), Dump(), lldb_private::AddressRange::Dump(), lldb_private::Symbol::Dump(), lldb_private::AddressRange::DumpDebug(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::BreakpointLocationList::FindByAddress(), DYLDRendezvous::FindMetadata(), lldb_private::Symbol::GetDescription(), lldb_private::Function::GetEndLineSourceInfo(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::StackFrame::GetFrameCodeAddressForSymbolication(), lldb_private::Symbol::GetIntegerValue(), lldb_private::Block::GetRangeContainingAddress(), lldb_private::Block::GetRangeIndexContainingAddress(), lldb_private::Symbol::GetReExportedSymbolName(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::RegisterContextUnwind::IsUnwindPlanValidForCurrentPC(), lldb_private::operator!=(), lldb_private::operator==(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), SymbolFileSymtab::ParseFunctions(), ReadCStringFromMemory(), ObjectFilePECOFF::ReadImageDataByRVA(), lldb_private::Target::ReadMemory(), lldb_private::Target::ReadMemoryFromFileCache(), ResolveAddress(), lldb_private::Module::ResolveSymbolContextForAddress(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::BreakpointResolverName::SearchCallback(), lldb_private::BreakpointResolverAddress::SerializeToStructuredData(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::DynamicLoaderDarwin::UnloadImages(), and lldb_private::ValueObjectMemory::ValueObjectMemory().

◆ GetOpcodeLoadAddress()

addr_t Address::GetOpcodeLoadAddress ( Target target,
AddressClass  addr_class = AddressClass::eInvalid 
) const

Get the load address as an opcode load address.

This function will first resolve its address to a load address. Then, if the address turns out to be in code address, return the load address for an opcode. This address object might have extra bits set (bit zero will be set to Thumb functions for an ARM target) that are required for changing the program counter and this function will remove any bits that are intended for these special purposes. The result of this function can be used to safely write a software breakpoint trap to memory.

Returns
The valid load virtual address with extra callable bits removed, or LLDB_INVALID_ADDRESS if the address is currently not loaded.

Definition at line 370 of file Address.cpp.

References lldb_private::eInvalid, GetAddressClass(), GetLoadAddress(), lldb_private::Target::GetOpcodeLoadAddress(), and LLDB_INVALID_ADDRESS.

Referenced by lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), lldb_private::AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(), lldb_private::Process::CreateBreakpointSite(), lldb_private::BreakpointLocation::Dump(), DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(), lldb_private::StackFrame::GetFrameCodeAddressForSymbolication(), lldb_private::BreakpointLocation::GetLoadAddress(), lldb::SBFrame::GetPC(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols(), lldb_private::BreakpointLocation::ResolveBreakpointSite(), lldb_private::ReportRetriever::SetupBreakpoint(), and lldb_private::ThreadPlanRunToAddress::ThreadPlanRunToAddress().

◆ GetSection()

lldb::SectionSP lldb_private::Address::GetSection ( ) const
inline

Get const accessor for the section.

Returns
Returns the const lldb::Section pointer that this address is an offset in, or NULL if this address is absolute.

Definition at line 439 of file Address.h.

References m_section_wp.

Referenced by ObjectFilePECOFF::AppendFromExportTable(), CalculateSymbolContext(), CalculateSymbolContextBlock(), CalculateSymbolContextCompileUnit(), CalculateSymbolContextFunction(), CalculateSymbolContextLineEntry(), CalculateSymbolContextModule(), lldb_private::Function::CalculateSymbolContextModule(), CalculateSymbolContextSymbol(), lldb_private::AddressRange::Contains(), lldb_private::AddressRange::ContainsFileAddress(), lldb_private::AddressRange::ContainsLoadAddress(), lldb_private::formatters::CXXFunctionPointerSummaryProvider(), CommandObjectThreadUntil::DoExecute(), Dump(), DumpAddressOffsetFromFunction(), lldb_private::AddressRange::DumpDebug(), CommandObjectMemoryRegion::DumpRegion(), lldb_private::Symbol::Encode(), lldb_private::ObjectFile::GetAddressClass(), ObjectFileMachO::GetAddressClass(), lldb_private::Symbol::GetDescription(), GetFileAddress(), GetLoadAddress(), GetModule(), getModuleFileSize(), lldb_private::Block::GetRangeContainingAddress(), lldb_private::Block::GetRangeIndexContainingAddress(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), IsSectionOffset(), lldb_private::Breakpoint::ModulesChanged(), lldb_private::operator!=(), lldb_private::operator==(), ObjectFileMachO::ParseSymtab(), ObjectFilePECOFF::ReadImageDataByRVA(), lldb_private::Target::ReadMemory(), lldb_private::Target::ReadMemoryFromFileCache(), RemoveFunctionsWithModuleNotEqualTo(), lldb_private::BreakpointResolverAddress::ResolveBreakpoint(), lldb_private::BreakpointResolverAddress::ResolveBreakpointInModules(), lldb_private::Module::ResolveSymbolContextForAddress(), SectionWasDeleted(), lldb_private::BreakpointResolverAddress::SerializeToStructuredData(), DisassemblerLLVMC::SymbolLookup(), and lldb_private::Symbol::ValueIsAddress().

◆ IsSectionOffset()

bool lldb_private::Address::IsSectionOffset ( ) const
inline

Check if an address is section offset.

When converting a virtual file or load address into a section offset based address, we often need to know if, given a section list, if the address was able to be converted to section offset. This function returns true if the current value contained in this object is section offset based.

Returns
Returns true if the address has a valid section and offset, false otherwise.

Definition at line 342 of file Address.h.

References GetSection(), and IsValid().

Referenced by Dump(), lldb_private::DWARFExpression::Evaluate(), lldb_private::BreakpointLocationList::FindByAddress(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::ItaniumABILanguageRuntime::GetTypeInfo(), lldb_private::Value::GetValueAsData(), lldb_private::Variable::LocationIsValidForAddress(), SymbolFileSymtab::ParseFunctions(), lldb_private::Target::ReadMemory(), ResolveAddress(), ResolveLoadAddress(), lldb_private::Module::ResolveSymbolContextForAddress(), and lldb_private::BreakpointResolverAddress::SearchCallback().

◆ IsValid()

bool lldb_private::Address::IsValid ( ) const
inline

Check if the object state is valid.

A valid Address object contains either a section pointer and offset (for section offset based addresses), or just a valid offset (for absolute addresses that have no section).

Returns
Returns true if the offset is valid, false otherwise.

Definition at line 355 of file Address.h.

References LLDB_INVALID_ADDRESS, and m_offset.

Referenced by lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), lldb_private::BreakpointResolver::AddLocation(), lldb_private::Process::AdvanceAddressToNextBranchInstruction(), UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(), lldb_private::x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(), BuildModulesSection(), CharStringSummaryProvider(), DynamicLoaderPOSIXDYLD::ComputeLoadOffset(), CreateAllImageInfosPayload(), lldb_private::Target::CreateBreakpoint(), lldb_private::npdb::SymbolFileNativePDB::CreateFunction(), lldb_private::formatters::CXXFunctionPointerSummaryProvider(), lldb_private::Disassembler::Disassemble(), lldb_private::Disassembler::DisassembleRange(), CommandObjectTargetModulesLoad::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), lldb_private::UnwindPlan::Dump(), DumpAddressOffsetFromFunction(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::DWARFCallFrameInfo::FDEToUnwindPlan(), lldb_private::SymbolContext::FindBestGlobalDataSymbol(), lldb_private::BreakpointLocationList::FindByAddress(), DynamicLoaderFreeBSDKernel::FindKernelAtLoadAddress(), UnwindAssembly_x86::FirstNonPrologueInsn(), lldb_private::FormatEntity::Format(), lldb_private::UnwindTable::GetAddressRange(), lldb_private::FuncUnwinders::GetArmUnwindUnwindPlan(), lldb_private::FuncUnwinders::GetCompactUnwindUnwindPlan(), lldb_private::FuncUnwinders::GetDebugFrameUnwindPlan(), DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(), lldb_private::FuncUnwinders::GetEHFrameUnwindPlan(), lldb_private::Target::GetEntryPointAddress(), ObjectFileELF::GetEntryPointAddress(), ObjectFileMachO::GetEntryPointAddress(), ObjectFilePECOFF::GetEntryPointAddress(), lldb_private::RegisterContextUnwind::GetFastUnwindPlanForFrame(), lldb_private::FuncUnwinders::GetFirstNonPrologueInsn(), lldb_private::StackFrame::GetFrameCodeAddressForSymbolication(), lldb_private::RegisterContextUnwind::GetFullUnwindPlanForFrame(), ProcessElfCore::GetImageInfoAddress(), lldb_private::ProcessWindows::GetImageInfoAddress(), UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(), UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::FuncUnwinders::GetObjectFileUnwindPlan(), lldb_private::DynamicLoaderDarwin::GetPthreadSetSpecificAddress(), lldb_private::RegisterContextUnwind::GetStartPC(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), JITLoaderGDB::GetSymbolAddress(), lldb_private::ClangExpressionDeclMap::GetSymbolAddress(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::Value::GetValueAsData(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), IsSectionOffset(), lldb_private::LineEntry::IsValid(), DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded(), lldb_private::UserExpression::LockAndCheckContext(), SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseFunction(), DWARFASTParserClang::ParseFunctionFromDWARF(), lldb_private::Disassembler::ParseInstructions(), lldb_private::DirectCallEdge::ParseSymbolFileAndResolve(), lldb_private::UnwindPlan::PlanValidAtAddress(), CommandObjectTargetModulesList::PrintModule(), DynamicLoaderDarwinKernel::ReadAllKextSummaries(), DynamicLoaderFreeBSDKernel::ReadAllKmods(), DynamicLoaderDarwinKernel::ReadKextSummaryHeader(), DynamicLoaderFreeBSDKernel::ReadKmodsListHeader(), lldb_private::Target::ReadMemory(), lldb_private::Target::ReadPointerFromMemory(), ResolveAddress(), lldb_private::Symbol::ResolveCallableAddress(), DYLDRendezvous::ResolveRendezvousAddress(), lldb_private::BreakpointResolverName::SearchCallback(), lldb_private::AddressResolverFileLine::SearchCallback(), DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(), lldb_private::EmulateInstruction::SetInstruction(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::UnwindPlan::SetPlanValidAddressRange(), lldb_private::ReportRetriever::SetupBreakpoint(), DisassemblerLLVMC::SymbolLookup(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), ValueObjectVTableChild::UpdateValue(), and lldb_private::formatters::WCharStringSummaryProvider().

◆ MemorySize()

size_t Address::MemorySize ( ) const

Get the memory cost of this object.

Returns
The number of bytes that this object occupies in memory.

Definition at line 973 of file Address.cpp.

References Address().

◆ operator=()

const Address & Address::operator= ( const Address rhs)

Assignment operator.

Copies the address value from another Address object rhs into this object.

Parameters
[in]rhsA const Address object reference to copy.
Returns
A const Address object reference to this.

Definition at line 242 of file Address.cpp.

References m_offset, and m_section_wp.

◆ ResolveAddressUsingFileSections()

bool Address::ResolveAddressUsingFileSections ( lldb::addr_t  addr,
const SectionList sections 
)

Resolve a file virtual address using a section list.

Given a list of sections, attempt to resolve addr as an offset into one of the file sections.

Returns
Returns true if addr was able to be resolved, false otherwise.

Definition at line 250 of file Address.cpp.

References lldb_private::SectionList::FindSectionContainingFileAddress(), m_offset, and m_section_wp.

Referenced by Address(), lldb_private::Symbol::Decode(), lldb_private::CompactUnwindInfo::GetCompactUnwindInfoForFunction(), ObjectFileELF::GetEntryPointAddress(), ObjectFileMachO::GetEntryPointAddress(), ObjectFilePECOFF::GetEntryPointAddress(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseFunction(), and lldb_private::Module::ResolveFileAddress().

◆ ResolveFunctionScope()

bool Address::ResolveFunctionScope ( lldb_private::SymbolContext sym_ctx,
lldb_private::AddressRange addr_range_ptr = nullptr 
)

Resolve this address to its containing function and optionally get that function's address range.

if "addr_range_ptr" is not NULL, then fill in with the address range of the function.

Parameters
[out]sym_ctxThe symbol context describing the function in which this address lies

\parm[out] addr_range_ptr Pointer to the AddressRange to fill in with the function's address range. Caller may pass null if they don't need the address range.

Returns
Returns false if the function/symbol could not be resolved or if the address range was requested and could not be resolved; returns true otherwise.

Definition at line 268 of file Address.cpp.

References CalculateSymbolContext(), lldb_private::AddressRange::Clear(), and lldb_private::SymbolContext::GetAddressRange().

Referenced by lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), and lldb_private::RegisterContextUnwind::PropagateTrapHandlerFlagFromUnwindPlan().

◆ SectionWasDeleted()

bool Address::SectionWasDeleted ( ) const

◆ SectionWasDeletedPrivate()

bool Address::SectionWasDeletedPrivate ( ) const
protected

Definition at line 817 of file Address.cpp.

References m_section_wp.

Referenced by GetFileAddress(), GetLoadAddress(), and SectionWasDeleted().

◆ SetCallableLoadAddress()

bool Address::SetCallableLoadAddress ( lldb::addr_t  load_addr,
Target target 
)

◆ SetLoadAddress()

bool Address::SetLoadAddress ( lldb::addr_t  load_addr,
Target target,
bool  allow_section_end = false 
)

Set the address to represent load_addr.

The address will attempt to find a loaded section within target that contains load_addr. If successful, this address object will have a valid section and offset. Else this address object will have no section (NULL) and the offset will be load_addr.

Parameters
[in]load_addrA load address from a current process.
[in]targetThe target to use when trying resolve the address into a section + offset. The Target's SectionLoadList object is used to resolve the address.
[in]allow_section_endIf true, treat an address pointing to the end of the module as belonging to that module.
Returns
Returns true if the load address was resolved to be section/offset, false otherwise. It is often ok for an address to not resolve to a section in a module, this often happens for JIT'ed code, or any load addresses on the stack or heap.

Definition at line 1046 of file Address.cpp.

References lldb_private::Target::GetSectionLoadList(), m_offset, m_section_wp, and lldb_private::SectionLoadList::ResolveLoadAddress().

Referenced by CalculateSymbolInfo(), lldb_private::formatters::CXXFunctionPointerSummaryProvider(), CommandObjectTargetModulesList::DoExecute(), Dump(), lldb::SBValue::GetAddress(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::ThreadPlanStepOut::GetDescription(), lldb_private::InstructionList::GetIndexOfInstructionAtLoadAddress(), lldb_private::RegisterContext::GetPCForSymbolication(), lldb_private::Block::GetRangeContainingLoadAddress(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::ScriptedThread::LoadArtificialStackFrames(), ABIMacOSX_arm::PrepareTrivialCall(), ABISysV_arm::PrepareTrivialCall(), lldb_private::Target::ReadMemory(), lldb_private::StackFrameList::ResetCurrentInlinedDepth(), SetCallableLoadAddress(), SetOpcodeLoadAddress(), and lldb_private::DynamicLoaderDarwin::UnloadImages().

◆ SetOffset()

bool lldb_private::Address::SetOffset ( lldb::addr_t  offset)
inline

◆ SetOpcodeLoadAddress()

bool Address::SetOpcodeLoadAddress ( lldb::addr_t  load_addr,
Target target,
AddressClass  addr_class = AddressClass::eInvalid,
bool  allow_section_end = false 
)

◆ SetRawAddress()

void lldb_private::Address::SetRawAddress ( lldb::addr_t  addr)
inline

◆ SetSection()

void lldb_private::Address::SetSection ( const lldb::SectionSP section_sp)
inline

Set accessor for the section.

Parameters
[in]section_spA new lldb::Section pointer to use as the section base. Can be NULL for absolute addresses that are not relative to any section.

Definition at line 473 of file Address.h.

References m_section_wp.

Referenced by ObjectFileMachO::GetBaseAddress(), ObjectFileMachO::ParseSymtab(), lldb_private::Section::ResolveContainedAddress(), and lldb::SBAddress::SetAddress().

◆ Slide()

bool lldb_private::Address::Slide ( int64_t  offset)
inline

Member Data Documentation

◆ m_offset

lldb::addr_t lldb_private::Address::m_offset = LLDB_INVALID_ADDRESS
protected

◆ m_section_wp

lldb::SectionWP lldb_private::Address::m_section_wp
protected

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