Package lldb :: Class SBAddress

[hide private]
[frames] | no frames]

# Class SBAddress

source code

    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:
        o file addresses
        o 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.

    See docstring of SBFunction for example usage of SBAddress.

Instance Methods | [hide private]

__setattr__(self, name, value) x.__setattr__('name', value) <==> x.name = value | source code

__getattr__(self, name) | source code

__repr__(self) repr(x) | source code

__eq__(self, other) | source code

__ne__(self, other) | source code

__init__(self, *args) __init__(lldb::SBAddress self) -> SBAddress __init__(lldb::SBAddress self, SBAddress rhs) -> SBAddress __init__(lldb::SBAddress self, SBSection section, lldb::addr_t offset) -> SBAddress __init__(lldb::SBAddress self, lldb::addr_t load_addr, SBTarget target) -> SBAddress | source code

__swig_destroy__(...) delete_SBAddress(SBAddress self) |

__del__(self) | source code

__nonzero__(self) | source code

IsValid(self) IsValid(SBAddress self) -> bool | source code

Clear(self) Clear(SBAddress self) | source code

GetFileAddress(self) GetFileAddress(SBAddress self) -> lldb::addr_t | source code

GetLoadAddress(self, *args) GetLoadAddress(SBAddress self, SBTarget target) -> lldb::addr_t | source code

SetLoadAddress(self, *args) SetLoadAddress(SBAddress self, lldb::addr_t load_addr, SBTarget target) | source code

OffsetAddress(self, *args) OffsetAddress(SBAddress self, lldb::addr_t offset) -> bool | source code

GetDescription(self, *args) GetDescription(SBAddress self, SBStream description) -> bool | source code

GetSection(self) GetSection(SBAddress self) -> SBSection | source code

GetOffset(self) GetOffset(SBAddress self) -> lldb::addr_t | source code

SetAddress(self, *args) SetAddress(SBAddress self, SBSection section, lldb::addr_t offset) | source code

GetAddressClass(self) GetAddressClass(SBAddress self) -> lldb::AddressClass | source code

GetSymbolContext(self, *args) GetSymbolContext(SBAddress self, uint32_t resolve_scope) -> SBSymbolContext | source code

GetModule(self) GetModule(SBAddress self) -> SBModule | source code

GetCompileUnit(self) GetCompileUnit(SBAddress self) -> SBCompileUnit | source code

GetFunction(self) GetFunction(SBAddress self) -> SBFunction | source code

GetBlock(self) GetBlock(SBAddress self) -> SBBlock | source code

GetSymbol(self) GetSymbol(SBAddress self) -> SBSymbol | source code

GetLineEntry(self) GetLineEntry(SBAddress self) -> SBLineEntry | source code

__get_load_addr_property__(self) Get the load address for a lldb.SBAddress using the current target. | source code

__set_load_addr_property__(self, load_addr) Set the load address for a lldb.SBAddress using the current target. | source code

__int__(self) Convert an address to a load address if there is a process and that process is alive, or to a file address otherwise. | source code

__oct__(self) Convert the address to an octal string | source code

__hex__(self) Convert the address to an hex string | source code

__str__(self) __str__(SBAddress self) -> PyObject * | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| __swig_setmethods__ = `{}`
| __swig_getmethods__ = `{}`

Properties | [hide private]

| block A read only property that returns an lldb object that represents the block (lldb.SBBlock) that this address resides within.
| compile_unit A read only property that returns an lldb object that represents the compile unit (lldb.SBCompileUnit) that this address resides within.
| file_addr A read only property that returns file address for the section as an integer.
| function A read only property that returns an lldb object that represents the function (lldb.SBFunction) that this address resides within.
| line_entry A read only property that returns an lldb object that represents the line entry (lldb.SBLineEntry) that this address resides within.
| load_addr A read/write property that gets/sets the SBAddress using load address.
| module A read only property that returns an lldb object that represents the module (lldb.SBModule) that this address resides within.
| offset A read only property that returns the section offset in bytes as an integer.
| section A read only property that returns an lldb object that represents the section (lldb.SBSection) that this address resides within.
| symbol A read only property that returns an lldb object that represents the symbol (lldb.SBSymbol) that this address resides within.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __setattr__(self, name, value)

source code

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
  (inherited documentation)

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __init__(self, *args)
(Constructor)

source code

__init__(lldb::SBAddress self) -> SBAddress __init__(lldb::SBAddress self, SBAddress rhs) -> SBAddress __init__(lldb::SBAddress self, SBSection section, lldb::addr_t offset) -> SBAddress __init__(lldb::SBAddress self, lldb::addr_t load_addr, SBTarget target) -> SBAddress

Create an address by resolving a load address using the supplied target.

Overrides: object.__init__

### GetSymbolContext(self, *args)

source code

GetSymbolContext(SBAddress self, uint32_t resolve_scope) -> SBSymbolContext

GetSymbolContext() and the following can lookup symbol information 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. The following functions will only return valid values if the address has been resolved to a code or data address using 'void SBAddress::SetLoadAddress(...)' or 'lldb::SBAddress SBTarget::ResolveLoadAddress (...)'.

### GetModule(self)

source code

    GetModule(SBAddress self) -> SBModule

    GetModule() and the following grab individual objects for a given address and
    are 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:
       lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t resolve_scope);
       lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const SBAddress &addr, uint32_t resolve_scope);
    One or more bits from the SymbolContextItem enumerations can be logically
    OR'ed together to more efficiently retrieve multiple symbol objects.

### __str__(self)
(Informal representation operator)

source code

__str__(SBAddress self) -> PyObject *

Overrides: object.__str__

Property Details | [hide private]

### block

A read only property that returns an lldb object that represents the block (lldb.SBBlock) that this address resides within.

Get Method:
  GetBlock(self) - GetBlock(SBAddress self) -> SBBlock

### compile_unit

A read only property that returns an lldb object that represents the compile unit (lldb.SBCompileUnit) that this address resides within.

Get Method:
  GetCompileUnit(self) - GetCompileUnit(SBAddress self) -> SBCompileUnit

### file_addr

A read only property that returns file address for the section as an integer. This is the address that represents the address as it is found in the object file that defines it.

Get Method:
  GetFileAddress(self) - GetFileAddress(SBAddress self) -> lldb::addr_t

### function

A read only property that returns an lldb object that represents the function (lldb.SBFunction) that this address resides within.

Get Method:
  GetFunction(self) - GetFunction(SBAddress self) -> SBFunction

### line_entry

A read only property that returns an lldb object that represents the line entry (lldb.SBLineEntry) that this address resides within.

Get Method:
  GetLineEntry(self) - GetLineEntry(SBAddress self) -> SBLineEntry

### load_addr

A read/write property that gets/sets the SBAddress using load address. The setter resolves SBAddress using the SBTarget from lldb.target.

Get Method:
  __get_load_addr_property__(self) - Get the load address for a lldb.SBAddress using the current target.
Set Method:
  __set_load_addr_property__(self, load_addr) - Set the load address for a lldb.SBAddress using the current target.

### module

A read only property that returns an lldb object that represents the module (lldb.SBModule) that this address resides within.

Get Method:
  GetModule(self) - GetModule(SBAddress self) -> SBModule

### offset

A read only property that returns the section offset in bytes as an integer.

Get Method:
  GetOffset(self) - GetOffset(SBAddress self) -> lldb::addr_t

### section

A read only property that returns an lldb object that represents the section (lldb.SBSection) that this address resides within.

Get Method:
  GetSection(self) - GetSection(SBAddress self) -> SBSection

### symbol

A read only property that returns an lldb object that represents the symbol (lldb.SBSymbol) that this address resides within.

Get Method:
  GetSymbol(self) - GetSymbol(SBAddress self) -> SBSymbol