1 //===-- SWIG Interface for SBSymbol -----------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 namespace lldb { 10 11 %feature("docstring", 12 "Represents the symbol possibly associated with a stack frame. 13 :py:class:`SBModule` contains SBSymbol(s). SBSymbol can also be retrieved from :py:class:`SBFrame` ." 14 ) SBSymbol; 15 class SBSymbol 16 { 17 public: 18 19 SBSymbol (); 20 21 ~SBSymbol (); 22 23 SBSymbol (const lldb::SBSymbol &rhs); 24 25 bool 26 IsValid () const; 27 28 explicit operator bool() const; 29 30 31 const char * 32 GetName() const; 33 34 const char * 35 GetDisplayName() const; 36 37 const char * 38 GetMangledName () const; 39 40 lldb::SBInstructionList 41 GetInstructions (lldb::SBTarget target); 42 43 lldb::SBInstructionList 44 GetInstructions (lldb::SBTarget target, const char *flavor_string); 45 46 SBAddress 47 GetStartAddress (); 48 49 SBAddress 50 GetEndAddress (); 51 52 uint64_t GetValue(); 53 54 uint64_t GetSize(); 55 56 uint32_t 57 GetPrologueByteSize (); 58 59 SymbolType 60 GetType (); 61 62 bool 63 GetDescription (lldb::SBStream &description); 64 65 bool 66 IsExternal(); 67 68 bool 69 IsSynthetic(); 70 71 bool 72 operator == (const lldb::SBSymbol &rhs) const; 73 74 bool 75 operator != (const lldb::SBSymbol &rhs) const; 76 77 STRING_EXTENSION(SBSymbol) 78 79 #ifdef SWIGPYTHON 80 %pythoncode %{ 81 def get_instructions_from_current_target (self): 82 return self.GetInstructions (target) 83 84 name = property(GetName, None, doc='''A read only property that returns the name for this symbol as a string.''') 85 mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this symbol as a string.''') 86 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.''') 87 addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this symbol.''') 88 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.''') 89 prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''') 90 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.''') 91 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.''') 92 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.''') 93 %} 94 #endif 95 96 }; 97 98 } // namespace lldb 99