Skip to content

Commit 18bd118

Browse files
[lldb][NFC] Add documentation for SBFrame::GetRegisters (#125969)
SBFrame::GetRegisters() (and the .registers / .regs extensions in Python) returns an array of register-set's, not registers like you might expect from the API name. Document this. --------- Co-authored-by: Will Hawkins <[email protected]>
1 parent cc0d4a5 commit 18bd118

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lldb/bindings/interface/SBFrameDocstrings.i

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ See also SBThread."
7878
See also GetFunctionName()."
7979
) lldb::SBFrame::IsInlined;
8080

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 register-set the 'General Purpose Registers', but that is not required.
91+
register-set may not use that exact name, it is only a convention
92+
used by some stubs.
93+
A register-set SBValue will have children, one child per register
94+
in the register-set."
95+
) lldb::SBFrame::GetRegisters;
96+
8197
%feature("docstring", "
8298
Return true if this frame is artificial (e.g a frame synthesized to
8399
capture a tail call). Local variables may not be available in an artificial

lldb/bindings/interface/SBFrameExtensions.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ STRING_EXTENSION_OUTSIDE(SBFrame)
8787
args = property(get_arguments, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the argument variables in this stack frame.''')
8888
arguments = property(get_arguments, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the argument variables in this stack frame.''')
8989
statics = property(get_statics, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the static variables in this stack frame.''')
90-
registers = property(GetRegisters, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the CPU registers for this stack frame.''')
91-
regs = property(GetRegisters, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the CPU registers for this stack frame.''')
90+
registers = property(GetRegisters, None, doc='''Returns the register sets for this thread as a list(). See SBFrame::GetRegisters() for details.''')
91+
regs = property(GetRegisters, None, doc='''Returns the register sets for this thread as a list(). See SBFrame::GetRegisters() for details.''')
9292
register = property(get_registers_access, None, doc='''A read only property that returns an helper object providing a flattened indexable view of the CPU registers for this stack frame.''')
9393
reg = property(get_registers_access, None, doc='''A read only property that returns an helper object providing a flattened indexable view of the CPU registers for this stack frame''')
9494
parent = property(get_parent_frame, None, doc='''A read only property that returns the parent (caller) frame of the current frame.''')

0 commit comments

Comments
 (0)