xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBFrameDocstrings.i (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
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     Return true if this frame is artificial (e.g a frame synthesized to
83     capture a tail call). Local variables may not be available in an artificial
84     frame."
85 ) lldb::SBFrame::IsArtificial;
86 
87 %feature("docstring", "
88     The version that doesn't supply a 'use_dynamic' value will use the
89     target's default."
90 ) lldb::SBFrame::EvaluateExpression;
91 
92 %feature("docstring", "
93     Gets the lexical block that defines the stack frame. Another way to think
94     of this is it will return the block that contains all of the variables
95     for a stack frame. Inlined functions are represented as SBBlock objects
96     that have inlined function information: the name of the inlined function,
97     where it was called from. The block that is returned will be the first
98     block at or above the block for the PC (SBFrame::GetBlock()) that defines
99     the scope of the frame. When a function contains no inlined functions,
100     this will be the top most lexical block that defines the function.
101     When a function has inlined functions and the PC is currently
102     in one of those inlined functions, this method will return the inlined
103     block that defines this frame. If the PC isn't currently in an inlined
104     function, the lexical block that defines the function is returned."
105 ) lldb::SBFrame::GetFrameBlock;
106 
107 %feature("docstring", "
108     The version that doesn't supply a 'use_dynamic' value will use the
109     target's default."
110 ) lldb::SBFrame::GetVariables;
111 
112 %feature("docstring", "
113     The version that doesn't supply a 'use_dynamic' value will use the
114     target's default."
115 ) lldb::SBFrame::FindVariable;
116 
117 %feature("docstring", "
118     Get a lldb.SBValue for a variable path.
119 
120     Variable paths can include access to pointer or instance members: ::
121 
122         rect_ptr->origin.y
123         pt.x
124 
125     Pointer dereferences: ::
126 
127         *this->foo_ptr
128         **argv
129 
130     Address of: ::
131 
132         &pt
133         &my_array[3].x
134 
135     Array accesses and treating pointers as arrays: ::
136 
137         int_array[1]
138         pt_ptr[22].x
139 
140     Unlike `EvaluateExpression()` which returns :py:class:`SBValue` objects
141     with constant copies of the values at the time of evaluation,
142     the result of this function is a value that will continue to
143     track the current value of the value as execution progresses
144     in the current frame."
145 ) lldb::SBFrame::GetValueForVariablePath;
146 
147 %feature("docstring", "
148     Find variables, register sets, registers, or persistent variables using
149     the frame as the scope.
150 
151     The version that doesn't supply a ``use_dynamic`` value will use the
152     target's default."
153 ) lldb::SBFrame::FindValue;
154