xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBFrameDocstrings.i (revision 1342eb5a832fa10e689a29faab3acb6054e4778c)
1 %feature("docstring",
2 "Represents one of the stack frames associated with a thread.
3 
4 SBThread contains SBFrame(s). For example (from test/lldbutil.py), ::
5 
6     def print_stacktrace(thread, string_buffer = False):
7         '''Prints a simple stack trace of this thread.'''
8 
9         ...
10 
11         for i in range(depth):
12             frame = thread.GetFrameAtIndex(i)
13             function = frame.GetFunction()
14 
15             load_addr = addrs[i].GetLoadAddress(target)
16             if not function:
17                 file_addr = addrs[i].GetFileAddress()
18                 start_addr = frame.GetSymbol().GetStartAddress().GetFileAddress()
19                 symbol_offset = file_addr - start_addr
20                 print >> output, '  frame #{num}: {addr:#016x} {mod}`{symbol} + {offset}'.format(
21                     num=i, addr=load_addr, mod=mods[i], symbol=symbols[i], offset=symbol_offset)
22             else:
23                 print >> output, '  frame #{num}: {addr:#016x} {mod}`{func} at {file}:{line} {args}'.format(
24                     num=i, addr=load_addr, mod=mods[i],
25                     func='%s [inlined]' % funcs[i] if frame.IsInlined() else funcs[i],
26                     file=files[i], line=lines[i],
27                     args=get_args_as_string(frame, showFuncName=False) if not frame.IsInlined() else '()')
28 
29         ...
30 
31 And, ::
32 
33     for frame in thread:
34         print frame
35 
36 See also SBThread."
37 ) lldb::SBFrame;
38 
39 %feature("docstring", "
40     Get the Canonical Frame Address for this stack frame.
41     This is the DWARF standard's definition of a CFA, a stack address
42     that remains constant throughout the lifetime of the function.
43     Returns an lldb::addr_t stack address, or LLDB_INVALID_ADDRESS if
44     the CFA cannot be determined."
45 ) lldb::SBFrame::GetCFA;
46 
47 %feature("docstring", "
48     Gets the deepest block that contains the frame PC.
49 
50     See also GetFrameBlock()."
51 ) lldb::SBFrame::GetBlock;
52 
53     %feature("docstring", "
54     Get the appropriate function name for this frame. Inlined functions in
55     LLDB are represented by Blocks that have inlined function information, so
56     just looking at the SBFunction or SBSymbol for a frame isn't enough.
57     This function will return the appropriate function, symbol or inlined
58     function name for the frame.
59 
60     This function returns:
61     - the name of the inlined function (if there is one)
62     - the name of the concrete function (if there is one)
63     - the name of the symbol (if there is one)
64     - NULL
65 
66     See also IsInlined()."
67 ) lldb::SBFrame::GetFunctionName;
68 
69 %feature("docstring", "
70     Returns the language of the frame's SBFunction, or if there.
71     is no SBFunction, guess the language from the mangled name.
72     ."
73 ) lldb::SBFrame::GuessLanguage;
74 
75 %feature("docstring", "
76     Return true if this frame represents an inlined function.
77 
78     See also GetFunctionName()."
79 ) lldb::SBFrame::IsInlined;
80 
81 %feature("docstring", "
82     Returns an SBValueList which is an array of one or more register
83     sets that exist for this thread.
84     Each SBValue in the SBValueList represents one register-set.
85     The first register-set will be the general purpose registers --
86     the registers printed by the `register read` command-line in lldb, with
87     no additional arguments.
88     The register-set SBValue will have a name, e.g.
89     SBFrame::GetRegisters().GetValueAtIndex(0).GetName()
90     By convention, certain stubs choose to name their general-purpose
91     register-set the 'General Purpose Registers', but that is not required.
92     A register-set SBValue will have children, one child per register
93     in the register-set."
94 ) lldb::SBFrame::GetRegisters;
95 
96 %feature("docstring", "
97     Return true if this frame is artificial (e.g a frame synthesized to
98     capture a tail call). Local variables may not be available in an artificial
99     frame."
100 ) lldb::SBFrame::IsArtificial;
101 
102 %feature("docstring", "
103     The version that doesn't supply a 'use_dynamic' value will use the
104     target's default."
105 ) lldb::SBFrame::EvaluateExpression;
106 
107 %feature("docstring", "
108     Gets the lexical block that defines the stack frame. Another way to think
109     of this is it will return the block that contains all of the variables
110     for a stack frame. Inlined functions are represented as SBBlock objects
111     that have inlined function information: the name of the inlined function,
112     where it was called from. The block that is returned will be the first
113     block at or above the block for the PC (SBFrame::GetBlock()) that defines
114     the scope of the frame. When a function contains no inlined functions,
115     this will be the top most lexical block that defines the function.
116     When a function has inlined functions and the PC is currently
117     in one of those inlined functions, this method will return the inlined
118     block that defines this frame. If the PC isn't currently in an inlined
119     function, the lexical block that defines the function is returned."
120 ) lldb::SBFrame::GetFrameBlock;
121 
122 %feature("docstring", "
123     The version that doesn't supply a 'use_dynamic' value will use the
124     target's default."
125 ) lldb::SBFrame::GetVariables;
126 
127 %feature("docstring", "
128     The version that doesn't supply a 'use_dynamic' value will use the
129     target's default."
130 ) lldb::SBFrame::FindVariable;
131 
132 %feature("docstring", "
133     Get a lldb.SBValue for a variable path.
134 
135     Variable paths can include access to pointer or instance members: ::
136 
137         rect_ptr->origin.y
138         pt.x
139 
140     Pointer dereferences: ::
141 
142         *this->foo_ptr
143         **argv
144 
145     Address of: ::
146 
147         &pt
148         &my_array[3].x
149 
150     Array accesses and treating pointers as arrays: ::
151 
152         int_array[1]
153         pt_ptr[22].x
154 
155     Unlike `EvaluateExpression()` which returns :py:class:`SBValue` objects
156     with constant copies of the values at the time of evaluation,
157     the result of this function is a value that will continue to
158     track the current value of the value as execution progresses
159     in the current frame."
160 ) lldb::SBFrame::GetValueForVariablePath;
161 
162 %feature("docstring", "
163     Find variables, register sets, registers, or persistent variables using
164     the frame as the scope.
165 
166     The version that doesn't supply a ``use_dynamic`` value will use the
167     target's default."
168 ) lldb::SBFrame::FindValue;
169