blob: 466fcfad796270e9c70d1bb6a20132f942351a5f [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
34to test module equality."
35) SBModule;
36class SBModule
37{
38public:
39
40 SBModule ();
41
42 SBModule (const SBModule &rhs);
43
44 ~SBModule ();
45
46 bool
47 IsValid () const;
48
49 %feature("docstring", "
50 //------------------------------------------------------------------
51 /// Get const accessor for the module file specification.
52 ///
53 /// This function returns the file for the module on the host system
54 /// that is running LLDB. This can differ from the path on the
55 /// platform since we might be doing remote debugging.
56 ///
57 /// @return
58 /// A const reference to the file specification object.
59 //------------------------------------------------------------------
60 ") GetFileSpec;
61 lldb::SBFileSpec
62 GetFileSpec () const;
63
64 %feature("docstring", "
65 //------------------------------------------------------------------
66 /// Get accessor for the module platform file specification.
67 ///
68 /// Platform file refers to the path of the module as it is known on
69 /// the remote system on which it is being debugged. For local
70 /// debugging this is always the same as Module::GetFileSpec(). But
71 /// remote debugging might mention a file '/usr/lib/liba.dylib'
72 /// which might be locally downloaded and cached. In this case the
73 /// platform file could be something like:
74 /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
75 /// The file could also be cached in a local developer kit directory.
76 ///
77 /// @return
78 /// A const reference to the file specification object.
79 //------------------------------------------------------------------
80 ") GetPlatformFileSpec;
81 lldb::SBFileSpec
82 GetPlatformFileSpec () const;
83
84 bool
85 SetPlatformFileSpec (const lldb::SBFileSpec &platform_file);
86
87 %feature("docstring", "Returns the UUID of the module as a Python string."
88 ) GetUUIDString;
89 const char *
90 GetUUIDString () const;
91
Greg Clayton3e8c25f2011-09-24 00:52:29 +000092 lldb::SBSection
93 FindSection (const char *sect_name);
94
95 lldb::SBAddress
96 ResolveFileAddress (lldb::addr_t vm_addr);
Johnny Chenfb35e2a2011-07-18 23:11:07 +000097
98 lldb::SBSymbolContext
99 ResolveSymbolContextForAddress (const lldb::SBAddress& addr,
100 uint32_t resolve_scope);
101
102 bool
103 GetDescription (lldb::SBStream &description);
104
105 size_t
106 GetNumSymbols ();
107
108 lldb::SBSymbol
109 GetSymbolAtIndex (size_t idx);
110
Greg Clayton3e8c25f2011-09-24 00:52:29 +0000111 size_t
112 GetNumSections ();
113
114 lldb::SBSection
115 GetSectionAtIndex (size_t idx);
116
117
Johnny Chenfb35e2a2011-07-18 23:11:07 +0000118 %feature("docstring", "
119 //------------------------------------------------------------------
120 /// Find functions by name.
121 ///
122 /// @param[in] name
123 /// The name of the function we are looking for.
124 ///
125 /// @param[in] name_type_mask
126 /// A logical OR of one or more FunctionNameType enum bits that
127 /// indicate what kind of names should be used when doing the
128 /// lookup. Bits include fully qualified names, base names,
129 /// C++ methods, or ObjC selectors.
130 /// See FunctionNameType for more details.
131 ///
132 /// @param[in] append
133 /// If true, any matches will be appended to \a sc_list, else
134 /// matches replace the contents of \a sc_list.
135 ///
136 /// @param[out] sc_list
137 /// A symbol context list that gets filled in with all of the
138 /// matches.
139 ///
140 /// @return
141 /// The number of matches added to \a sc_list.
142 //------------------------------------------------------------------
143 ") FindFunctions;
144 uint32_t
145 FindFunctions (const char *name,
146 uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
147 bool append,
148 lldb::SBSymbolContextList& sc_list);
Enrico Granata979e20d2011-07-29 19:53:35 +0000149
150 lldb::SBType
151 FindFirstType (const char* name);
152
153 lldb::SBTypeList
154 FindTypes (const char* type);
155
Johnny Chenfb35e2a2011-07-18 23:11:07 +0000156
157 %feature("docstring", "
158 //------------------------------------------------------------------
159 /// Find global and static variables by name.
160 ///
161 /// @param[in] target
162 /// A valid SBTarget instance representing the debuggee.
163 ///
164 /// @param[in] name
165 /// The name of the global or static variable we are looking
166 /// for.
167 ///
168 /// @param[in] max_matches
169 /// Allow the number of matches to be limited to \a max_matches.
170 ///
171 /// @return
172 /// A list of matched variables in an SBValueList.
173 //------------------------------------------------------------------
174 ") FindGlobalVariables;
175 lldb::SBValueList
176 FindGlobalVariables (lldb::SBTarget &target,
177 const char *name,
178 uint32_t max_matches);
179};
180
181} // namespace lldb