xref: /llvm-project/lldb/bindings/interface/SBSymbolExtensions.i (revision 6813ef37377e8d8fadf6efe01e1ed80cc53b9c86)
1662548c8SAlex Langford STRING_EXTENSION_OUTSIDE(SBSymbol)
2662548c8SAlex Langford 
3662548c8SAlex Langford %extend lldb::SBSymbol {
4662548c8SAlex Langford #ifdef SWIGPYTHON
5662548c8SAlex Langford     %pythoncode %{
6*6813ef37SMed Ismail Bennani         # operator== is a free function, which swig does not handle, so we inject
7*6813ef37SMed Ismail Bennani         # our own equality operator here
8*6813ef37SMed Ismail Bennani         def __eq__(self, other):
9*6813ef37SMed Ismail Bennani             return not self.__ne__(other)
10*6813ef37SMed Ismail Bennani 
11*6813ef37SMed Ismail Bennani         def __hex__(self):
12*6813ef37SMed Ismail Bennani             return self.GetStartAddress()
13*6813ef37SMed Ismail Bennani 
14662548c8SAlex Langford         def get_instructions_from_current_target (self):
15662548c8SAlex Langford             return self.GetInstructions (target)
16662548c8SAlex Langford 
17662548c8SAlex Langford         name = property(GetName, None, doc='''A read only property that returns the name for this symbol as a string.''')
18662548c8SAlex Langford         mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this symbol as a string.''')
19662548c8SAlex Langford         type = property(GetType, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eSymbolType") that represents the type of this symbol.''')
20662548c8SAlex Langford         addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this symbol.''')
21662548c8SAlex Langford         end_addr = property(GetEndAddress, None, doc='''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this symbol.''')
22662548c8SAlex Langford         prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''')
23662548c8SAlex Langford         instructions = property(get_instructions_from_current_target, None, doc='''A read only property that returns an lldb object that represents the instructions (lldb.SBInstructionList) for this symbol.''')
24662548c8SAlex Langford         external = property(IsExternal, None, doc='''A read only property that returns a boolean value that indicates if this symbol is externally visiable (exported) from the module that contains it.''')
25662548c8SAlex Langford         synthetic = property(IsSynthetic, None, doc='''A read only property that returns a boolean value that indicates if this symbol was synthetically created from information in module that contains it.''')
26662548c8SAlex Langford     %}
27662548c8SAlex Langford #endif
28662548c8SAlex Langford }
29