Johnny Chen | fb35e2a | 2011-07-18 23:11:07 +0000 | [diff] [blame] | 1 | //===-- 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 | |
| 10 | namespace lldb { |
| 11 | |
| 12 | %feature("docstring", |
| 13 | "Represents an executable image and its associated object and symbol files. |
| 14 | |
| 15 | The module is designed to be able to select a single slice of an |
| 16 | executable image as it would appear on disk and during program |
| 17 | execution. |
| 18 | |
| 19 | You can retrieve SBModule from SBSymbolContext, which in turn is available |
| 20 | from SBFrame. |
| 21 | |
| 22 | SBModule supports symbol iteration, for example, |
| 23 | |
| 24 | for symbol in module: |
| 25 | name = symbol.GetName() |
| 26 | saddr = symbol.GetStartAddress() |
| 27 | eaddr = symbol.GetEndAddress() |
| 28 | |
| 29 | and 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 | |
| 34 | to test module equality." |
| 35 | ) SBModule; |
| 36 | class SBModule |
| 37 | { |
| 38 | public: |
| 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); |
Enrico Granata | 979e20d | 2011-07-29 19:53:35 +0000 | [diff] [blame] | 140 | |
| 141 | lldb::SBType |
| 142 | FindFirstType (const char* name); |
| 143 | |
| 144 | lldb::SBTypeList |
| 145 | FindTypes (const char* type); |
| 146 | |
Johnny Chen | fb35e2a | 2011-07-18 23:11:07 +0000 | [diff] [blame] | 147 | |
| 148 | %feature("docstring", " |
| 149 | //------------------------------------------------------------------ |
| 150 | /// Find global and static variables by name. |
| 151 | /// |
| 152 | /// @param[in] target |
| 153 | /// A valid SBTarget instance representing the debuggee. |
| 154 | /// |
| 155 | /// @param[in] name |
| 156 | /// The name of the global or static variable we are looking |
| 157 | /// for. |
| 158 | /// |
| 159 | /// @param[in] max_matches |
| 160 | /// Allow the number of matches to be limited to \a max_matches. |
| 161 | /// |
| 162 | /// @return |
| 163 | /// A list of matched variables in an SBValueList. |
| 164 | //------------------------------------------------------------------ |
| 165 | ") FindGlobalVariables; |
| 166 | lldb::SBValueList |
| 167 | FindGlobalVariables (lldb::SBTarget &target, |
| 168 | const char *name, |
| 169 | uint32_t max_matches); |
| 170 | }; |
| 171 | |
| 172 | } // namespace lldb |