pub struct SBAddress {
pub raw: SBAddressRef,
}
Expand description
A section + offset based address class.
The SBAddress
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
- load addresses
File addresses represents 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 represents 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.
Fields
raw: SBAddressRef
The underlying raw SBAddressRef
.
Implementations
sourceimpl SBAddress
impl SBAddress
sourcepub fn from_section_offset(section: &SBSection, offset: lldb_addr_t) -> SBAddress
pub fn from_section_offset(section: &SBSection, offset: lldb_addr_t) -> SBAddress
Construct a new SBAddress
from the given section and offset.
sourcepub fn from_load_address(load_addr: lldb_addr_t, target: &SBTarget) -> SBAddress
pub fn from_load_address(load_addr: lldb_addr_t, target: &SBTarget) -> SBAddress
Create a new SBAddress
from the given load address within the target.
sourcepub fn file_address(&self) -> u64
pub fn file_address(&self) -> u64
The address that represents the address as it is found in the object file that defines it.
sourcepub fn load_address(&self, target: &SBTarget) -> u64
pub fn load_address(&self, target: &SBTarget) -> u64
The address as it has been loaded into memory by a target.
sourcepub fn symbol_context(&self, resolve_scope: u32) -> SBSymbolContext
pub fn symbol_context(&self, resolve_scope: u32) -> SBSymbolContext
Get the SBSymbolContext
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
resolve_scope
: Flags that specify what type of symbol context is needed by the caller. These flags have constants starting withSYMBOL_CONTEXT_ITEM_
.
sourcepub fn module(&self) -> Option<SBModule>
pub fn module(&self) -> Option<SBModule>
Get the SBModule
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.
sourcepub fn compile_unit(&self) -> Option<SBCompileUnit>
pub fn compile_unit(&self) -> Option<SBCompileUnit>
Get the SBCompileUnit
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.
sourcepub fn function(&self) -> Option<SBFunction>
pub fn function(&self) -> Option<SBFunction>
Get the SBFunction
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.
sourcepub fn block(&self) -> Option<SBBlock>
pub fn block(&self) -> Option<SBBlock>
Get the SBBlock
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.
sourcepub fn symbol(&self) -> Option<SBSymbol>
pub fn symbol(&self) -> Option<SBSymbol>
Get the SBSymbol
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.
sourcepub fn line_entry(&self) -> Option<SBLineEntry>
pub fn line_entry(&self) -> Option<SBLineEntry>
Get the SBLineEntry
for a given address.
An address might refer to code or data from an existing
module, or it might refer to something on the stack or heap.
This will only return valid values if the address has been
resolved to a code or data address using
SBAddress::from_load_address
or SBTarget::resolve_load_address
.
This grabs an individual object for a given address and is less efficient if you want more than one symbol related objects. Use one of the following when you want multiple debug symbol related objects for an address:
SBAddress::symbol_context
SBTarget::resolve_symbol_context_for_address
One or more bits from the SymbolContextItem
enumerations can be logically
OR’ed together to more efficiently retrieve multiple symbol objects.