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     uint32_t
53     GetPrologueByteSize ();
54 
55     SymbolType
56     GetType ();
57 
58     bool
59     GetDescription (lldb::SBStream &description);
60 
61     bool
62     IsExternal();
63 
64     bool
65     IsSynthetic();
66 
67     bool
68     operator == (const lldb::SBSymbol &rhs) const;
69 
70     bool
71     operator != (const lldb::SBSymbol &rhs) const;
72 
73     STRING_EXTENSION(SBSymbol)
74 
75 #ifdef SWIGPYTHON
76     %pythoncode %{
77         def get_instructions_from_current_target (self):
78             return self.GetInstructions (target)
79 
80         name = property(GetName, None, doc='''A read only property that returns the name for this symbol as a string.''')
81         mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this symbol as a string.''')
82         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.''')
83         addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this symbol.''')
84         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.''')
85         prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''')
86         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.''')
87         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.''')
88         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.''')
89     %}
90 #endif
91 
92 };
93 
94 } // namespace lldb
95