xref: /freebsd-src/contrib/llvm-project/lldb/bindings/interface/SBAddressDocstrings.i (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1*06c3fb27SDimitry Andric %feature("docstring",
2*06c3fb27SDimitry Andric "A section + offset based address class.
3*06c3fb27SDimitry Andric 
4*06c3fb27SDimitry Andric The SBAddress class allows addresses to be relative to a section
5*06c3fb27SDimitry Andric that can move during runtime due to images (executables, shared
6*06c3fb27SDimitry Andric libraries, bundles, frameworks) being loaded at different
7*06c3fb27SDimitry Andric addresses than the addresses found in the object file that
8*06c3fb27SDimitry Andric represents them on disk. There are currently two types of addresses
9*06c3fb27SDimitry Andric for a section:
10*06c3fb27SDimitry Andric 
11*06c3fb27SDimitry Andric * file addresses
12*06c3fb27SDimitry Andric * load addresses
13*06c3fb27SDimitry Andric 
14*06c3fb27SDimitry Andric File addresses represents the virtual addresses that are in the 'on
15*06c3fb27SDimitry Andric disk' object files. These virtual addresses are converted to be
16*06c3fb27SDimitry Andric relative to unique sections scoped to the object file so that
17*06c3fb27SDimitry Andric when/if the addresses slide when the images are loaded/unloaded
18*06c3fb27SDimitry Andric in memory, we can easily track these changes without having to
19*06c3fb27SDimitry Andric update every object (compile unit ranges, line tables, function
20*06c3fb27SDimitry Andric address ranges, lexical block and inlined subroutine address
21*06c3fb27SDimitry Andric ranges, global and static variables) each time an image is loaded or
22*06c3fb27SDimitry Andric unloaded.
23*06c3fb27SDimitry Andric 
24*06c3fb27SDimitry Andric Load addresses represents the virtual addresses where each section
25*06c3fb27SDimitry Andric ends up getting loaded at runtime. Before executing a program, it
26*06c3fb27SDimitry Andric is common for all of the load addresses to be unresolved. When a
27*06c3fb27SDimitry Andric DynamicLoader plug-in receives notification that shared libraries
28*06c3fb27SDimitry Andric have been loaded/unloaded, the load addresses of the main executable
29*06c3fb27SDimitry Andric and any images (shared libraries) will be  resolved/unresolved. When
30*06c3fb27SDimitry Andric this happens, breakpoints that are in one of these sections can be
31*06c3fb27SDimitry Andric set/cleared.
32*06c3fb27SDimitry Andric 
33*06c3fb27SDimitry Andric See docstring of SBFunction for example usage of SBAddress."
34*06c3fb27SDimitry Andric ) lldb::SBAddress;
35*06c3fb27SDimitry Andric 
36*06c3fb27SDimitry Andric %feature("docstring", "
37*06c3fb27SDimitry Andric     Create an address by resolving a load address using the supplied target.")
38*06c3fb27SDimitry Andric lldb::SBAddress::SBAddress;
39*06c3fb27SDimitry Andric 
40*06c3fb27SDimitry Andric %feature("docstring", "
41*06c3fb27SDimitry Andric     GetSymbolContext() and the following can lookup symbol information for a given address.
42*06c3fb27SDimitry Andric     An address might refer to code or data from an existing module, or it
43*06c3fb27SDimitry Andric     might refer to something on the stack or heap. The following functions
44*06c3fb27SDimitry Andric     will only return valid values if the address has been resolved to a code
45*06c3fb27SDimitry Andric     or data address using :py:class:`SBAddress.SetLoadAddress' or
46*06c3fb27SDimitry Andric     :py:class:`SBTarget.ResolveLoadAddress`.") lldb::SBAddress::GetSymbolContext;
47*06c3fb27SDimitry Andric 
48*06c3fb27SDimitry Andric %feature("docstring", "
49*06c3fb27SDimitry Andric     GetModule() and the following grab individual objects for a given address and
50*06c3fb27SDimitry Andric     are less efficient if you want more than one symbol related objects.
51*06c3fb27SDimitry Andric     Use :py:class:`SBAddress.GetSymbolContext` or
52*06c3fb27SDimitry Andric     :py:class:`SBTarget.ResolveSymbolContextForAddress` when you want multiple
53*06c3fb27SDimitry Andric     debug symbol related objects for an address.
54*06c3fb27SDimitry Andric     One or more bits from the SymbolContextItem enumerations can be logically
55*06c3fb27SDimitry Andric     OR'ed together to more efficiently retrieve multiple symbol objects.")
56*06c3fb27SDimitry Andric lldb::SBAddress::GetModule;
57