blob: cea05e7ce9d53828b809a093109a6a483cbc737b [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
92 bool
93 ResolveFileAddress (lldb::addr_t vm_addr,
94 lldb::SBAddress& addr);
95
96 lldb::SBSymbolContext
97 ResolveSymbolContextForAddress (const lldb::SBAddress& addr,
98 uint32_t resolve_scope);
99
100 bool
101 GetDescription (lldb::SBStream &description);
102
103 size_t
104 GetNumSymbols ();
105
106 lldb::SBSymbol
107 GetSymbolAtIndex (size_t idx);
108
109 %feature("docstring", "
110 //------------------------------------------------------------------
111 /// Find functions by name.
112 ///
113 /// @param[in] name
114 /// The name of the function we are looking for.
115 ///
116 /// @param[in] name_type_mask
117 /// A logical OR of one or more FunctionNameType enum bits that
118 /// indicate what kind of names should be used when doing the
119 /// lookup. Bits include fully qualified names, base names,
120 /// C++ methods, or ObjC selectors.
121 /// See FunctionNameType for more details.
122 ///
123 /// @param[in] append
124 /// If true, any matches will be appended to \a sc_list, else
125 /// matches replace the contents of \a sc_list.
126 ///
127 /// @param[out] sc_list
128 /// A symbol context list that gets filled in with all of the
129 /// matches.
130 ///
131 /// @return
132 /// The number of matches added to \a sc_list.
133 //------------------------------------------------------------------
134 ") FindFunctions;
135 uint32_t
136 FindFunctions (const char *name,
137 uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
138 bool append,
139 lldb::SBSymbolContextList& sc_list);
140
141 %feature("docstring", "
142 //------------------------------------------------------------------
143 /// Find global and static variables by name.
144 ///
145 /// @param[in] target
146 /// A valid SBTarget instance representing the debuggee.
147 ///
148 /// @param[in] name
149 /// The name of the global or static variable we are looking
150 /// for.
151 ///
152 /// @param[in] max_matches
153 /// Allow the number of matches to be limited to \a max_matches.
154 ///
155 /// @return
156 /// A list of matched variables in an SBValueList.
157 //------------------------------------------------------------------
158 ") FindGlobalVariables;
159 lldb::SBValueList
160 FindGlobalVariables (lldb::SBTarget &target,
161 const char *name,
162 uint32_t max_matches);
163};
164
165} // namespace lldb