blob: b85b8965024abeb38792a77d69521bc1e4559f11 [file] [log] [blame]
Johnny Chenfb35e2a2011-07-18 23:11:07 +00001//===-- SWIG Interface for SBModule -----------------------------*- 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"Represents an executable image and its associated object and symbol files.
14
15The module is designed to be able to select a single slice of an
16executable image as it would appear on disk and during program
17execution.
18
19You can retrieve SBModule from SBSymbolContext, which in turn is available
20from SBFrame.
21
22SBModule supports symbol iteration, for example,
23
24 for symbol in module:
25 name = symbol.GetName()
26 saddr = symbol.GetStartAddress()
27 eaddr = symbol.GetEndAddress()
28
29and rich comparion methods which allow the API program to use,
30
31 if thisModule == thatModule:
32 print 'This module is the same as that module'
33
Johnny Chendc0cbd12011-09-24 04:51:43 +000034to test module equality. A module also contains object file sections, namely
35SBSection. SBModule supports section iteration through section_iter()."
Johnny Chenfb35e2a2011-07-18 23:11:07 +000036) SBModule;
37class SBModule
38{
39public:
40
41 SBModule ();
42
43 SBModule (const SBModule &rhs);
44
45 ~SBModule ();
46
47 bool
48 IsValid () const;
49
50 %feature("docstring", "
51 //------------------------------------------------------------------
52 /// Get const accessor for the module file specification.
53 ///
54 /// This function returns the file for the module on the host system
55 /// that is running LLDB. This can differ from the path on the
56 /// platform since we might be doing remote debugging.
57 ///
58 /// @return
59 /// A const reference to the file specification object.
60 //------------------------------------------------------------------
61 ") GetFileSpec;
62 lldb::SBFileSpec
63 GetFileSpec () const;
64
65 %feature("docstring", "
66 //------------------------------------------------------------------
67 /// Get accessor for the module platform file specification.
68 ///
69 /// Platform file refers to the path of the module as it is known on
70 /// the remote system on which it is being debugged. For local
71 /// debugging this is always the same as Module::GetFileSpec(). But
72 /// remote debugging might mention a file '/usr/lib/liba.dylib'
73 /// which might be locally downloaded and cached. In this case the
74 /// platform file could be something like:
75 /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
76 /// The file could also be cached in a local developer kit directory.
77 ///
78 /// @return
79 /// A const reference to the file specification object.
80 //------------------------------------------------------------------
81 ") GetPlatformFileSpec;
82 lldb::SBFileSpec
83 GetPlatformFileSpec () const;
84
85 bool
86 SetPlatformFileSpec (const lldb::SBFileSpec &platform_file);
87
88 %feature("docstring", "Returns the UUID of the module as a Python string."
89 ) GetUUIDString;
90 const char *
91 GetUUIDString () const;
92
Greg Clayton3e8c25f2011-09-24 00:52:29 +000093 lldb::SBSection
94 FindSection (const char *sect_name);
95
96 lldb::SBAddress
97 ResolveFileAddress (lldb::addr_t vm_addr);
Johnny Chenfb35e2a2011-07-18 23:11:07 +000098
99 lldb::SBSymbolContext
100 ResolveSymbolContextForAddress (const lldb::SBAddress& addr,
101 uint32_t resolve_scope);
102
103 bool
104 GetDescription (lldb::SBStream &description);
105
106 size_t
107 GetNumSymbols ();
108
109 lldb::SBSymbol
110 GetSymbolAtIndex (size_t idx);
111
Greg Clayton3e8c25f2011-09-24 00:52:29 +0000112 size_t
113 GetNumSections ();
114
115 lldb::SBSection
116 GetSectionAtIndex (size_t idx);
117
118
Johnny Chenfb35e2a2011-07-18 23:11:07 +0000119 %feature("docstring", "
120 //------------------------------------------------------------------
121 /// Find functions by name.
122 ///
123 /// @param[in] name
124 /// The name of the function we are looking for.
125 ///
126 /// @param[in] name_type_mask
127 /// A logical OR of one or more FunctionNameType enum bits that
128 /// indicate what kind of names should be used when doing the
129 /// lookup. Bits include fully qualified names, base names,
130 /// C++ methods, or ObjC selectors.
131 /// See FunctionNameType for more details.
132 ///
133 /// @param[in] append
134 /// If true, any matches will be appended to \a sc_list, else
135 /// matches replace the contents of \a sc_list.
136 ///
137 /// @param[out] sc_list
138 /// A symbol context list that gets filled in with all of the
139 /// matches.
140 ///
141 /// @return
142 /// The number of matches added to \a sc_list.
143 //------------------------------------------------------------------
144 ") FindFunctions;
145 uint32_t
146 FindFunctions (const char *name,
147 uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
148 bool append,
149 lldb::SBSymbolContextList& sc_list);
Enrico Granata979e20d2011-07-29 19:53:35 +0000150
151 lldb::SBType
152 FindFirstType (const char* name);
153
154 lldb::SBTypeList
155 FindTypes (const char* type);
156
Johnny Chenfb35e2a2011-07-18 23:11:07 +0000157
158 %feature("docstring", "
159 //------------------------------------------------------------------
160 /// Find global and static variables by name.
161 ///
162 /// @param[in] target
163 /// A valid SBTarget instance representing the debuggee.
164 ///
165 /// @param[in] name
166 /// The name of the global or static variable we are looking
167 /// for.
168 ///
169 /// @param[in] max_matches
170 /// Allow the number of matches to be limited to \a max_matches.
171 ///
172 /// @return
173 /// A list of matched variables in an SBValueList.
174 //------------------------------------------------------------------
175 ") FindGlobalVariables;
176 lldb::SBValueList
177 FindGlobalVariables (lldb::SBTarget &target,
178 const char *name,
179 uint32_t max_matches);
180};
181
182} // namespace lldb