xref: /freebsd-src/contrib/llvm-project/lldb/bindings/interface/SBSymbolExtensions.i (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
106c3fb27SDimitry Andric STRING_EXTENSION_OUTSIDE(SBSymbol)
206c3fb27SDimitry Andric 
306c3fb27SDimitry Andric %extend lldb::SBSymbol {
406c3fb27SDimitry Andric #ifdef SWIGPYTHON
506c3fb27SDimitry Andric     %pythoncode %{
6*5f757f3fSDimitry Andric         # operator== is a free function, which swig does not handle, so we inject
7*5f757f3fSDimitry Andric         # our own equality operator here
8*5f757f3fSDimitry Andric         def __eq__(self, other):
9*5f757f3fSDimitry Andric             return not self.__ne__(other)
10*5f757f3fSDimitry Andric 
11*5f757f3fSDimitry Andric         def __hex__(self):
12*5f757f3fSDimitry Andric             return self.GetStartAddress()
13*5f757f3fSDimitry Andric 
1406c3fb27SDimitry Andric         def get_instructions_from_current_target (self):
1506c3fb27SDimitry Andric             return self.GetInstructions (target)
1606c3fb27SDimitry Andric 
1706c3fb27SDimitry Andric         name = property(GetName, None, doc='''A read only property that returns the name for this symbol as a string.''')
1806c3fb27SDimitry Andric         mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this symbol as a string.''')
1906c3fb27SDimitry Andric         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.''')
2006c3fb27SDimitry Andric         addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this symbol.''')
2106c3fb27SDimitry Andric         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.''')
2206c3fb27SDimitry Andric         prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''')
2306c3fb27SDimitry Andric         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.''')
2406c3fb27SDimitry Andric         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.''')
2506c3fb27SDimitry Andric         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.''')
2606c3fb27SDimitry Andric     %}
2706c3fb27SDimitry Andric #endif
2806c3fb27SDimitry Andric }
29