blob: 83d624fb9272feb86ac30e7bd5985d524832bad2 [file] [log] [blame]
Johnny Chen3cfd5e82011-07-18 21:30:21 +00001//===-- SWIG Interface for SBAddress ----------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10namespace lldb {
11
12%feature("docstring",
13"A section + offset based address class.
14
15The SBAddress class allows addresses to be relative to a section
16that can move during runtime due to images (executables, shared
17libraries, bundles, frameworks) being loaded at different
18addresses than the addresses found in the object file that
19represents them on disk. There are currently two types of addresses
20for a section:
21 o file addresses
22 o load addresses
23
24File addresses represents the virtual addresses that are in the 'on
25disk' object files. These virtual addresses are converted to be
26relative to unique sections scoped to the object file so that
27when/if the addresses slide when the images are loaded/unloaded
28in memory, we can easily track these changes without having to
29update every object (compile unit ranges, line tables, function
30address ranges, lexical block and inlined subroutine address
31ranges, global and static variables) each time an image is loaded or
32unloaded.
33
34Load addresses represents the virtual addresses where each section
35ends up getting loaded at runtime. Before executing a program, it
36is common for all of the load addresses to be unresolved. When a
37DynamicLoader plug-in receives notification that shared libraries
38have been loaded/unloaded, the load addresses of the main executable
39and any images (shared libraries) will be resolved/unresolved. When
40this happens, breakpoints that are in one of these sections can be
41set/cleared.
42
43See docstring of SBFunction for example usage of SBAddress."
44) SBAddress;
45class SBAddress
46{
47public:
48
49 SBAddress ();
50
51 SBAddress (const lldb::SBAddress &rhs);
52
53 ~SBAddress ();
54
55 bool
56 IsValid () const;
57
58 void
59 Clear ();
60
61 addr_t
62 GetFileAddress () const;
63
64 addr_t
65 GetLoadAddress (const lldb::SBTarget &target) const;
66
67 bool
68 OffsetAddress (addr_t offset);
69
70 bool
71 GetDescription (lldb::SBStream &description);
72
73 SectionType
74 GetSectionType ();
75
76 lldb::SBModule
77 GetModule ();
78};
79
80} // namespace lldb