1*06c3fb27SDimitry Andric %feature("docstring", 2*06c3fb27SDimitry Andric "Represents a collection of SBValues. Both :py:class:`SBFrame.GetVariables()` and 3*06c3fb27SDimitry Andric :py:class:`SBFrame.GetRegisters()` return a SBValueList. 4*06c3fb27SDimitry Andric 5*06c3fb27SDimitry Andric SBValueList supports :py:class:`SBValue` iteration. For example (from test/lldbutil.py),:: 6*06c3fb27SDimitry Andric 7*06c3fb27SDimitry Andric def get_registers(frame, kind): 8*06c3fb27SDimitry Andric '''Returns the registers given the frame and the kind of registers desired. 9*06c3fb27SDimitry Andric 10*06c3fb27SDimitry Andric Returns None if there's no such kind. 11*06c3fb27SDimitry Andric ''' 12*06c3fb27SDimitry Andric registerSet = frame.GetRegisters() # Return type of SBValueList. 13*06c3fb27SDimitry Andric for value in registerSet: 14*06c3fb27SDimitry Andric if kind.lower() in value.GetName().lower(): 15*06c3fb27SDimitry Andric return value 16*06c3fb27SDimitry Andric 17*06c3fb27SDimitry Andric return None 18*06c3fb27SDimitry Andric 19*06c3fb27SDimitry Andric def get_GPRs(frame): 20*06c3fb27SDimitry Andric '''Returns the general purpose registers of the frame as an SBValue. 21*06c3fb27SDimitry Andric 22*06c3fb27SDimitry Andric The returned SBValue object is iterable. An example: 23*06c3fb27SDimitry Andric ... 24*06c3fb27SDimitry Andric from lldbutil import get_GPRs 25*06c3fb27SDimitry Andric regs = get_GPRs(frame) 26*06c3fb27SDimitry Andric for reg in regs: 27*06c3fb27SDimitry Andric print('%s => %s' % (reg.GetName(), reg.GetValue())) 28*06c3fb27SDimitry Andric ... 29*06c3fb27SDimitry Andric ''' 30*06c3fb27SDimitry Andric return get_registers(frame, 'general purpose') 31*06c3fb27SDimitry Andric 32*06c3fb27SDimitry Andric def get_FPRs(frame): 33*06c3fb27SDimitry Andric '''Returns the floating point registers of the frame as an SBValue. 34*06c3fb27SDimitry Andric 35*06c3fb27SDimitry Andric The returned SBValue object is iterable. An example: 36*06c3fb27SDimitry Andric ... 37*06c3fb27SDimitry Andric from lldbutil import get_FPRs 38*06c3fb27SDimitry Andric regs = get_FPRs(frame) 39*06c3fb27SDimitry Andric for reg in regs: 40*06c3fb27SDimitry Andric print('%s => %s' % (reg.GetName(), reg.GetValue())) 41*06c3fb27SDimitry Andric ... 42*06c3fb27SDimitry Andric ''' 43*06c3fb27SDimitry Andric return get_registers(frame, 'floating point') 44*06c3fb27SDimitry Andric 45*06c3fb27SDimitry Andric def get_ESRs(frame): 46*06c3fb27SDimitry Andric '''Returns the exception state registers of the frame as an SBValue. 47*06c3fb27SDimitry Andric 48*06c3fb27SDimitry Andric The returned SBValue object is iterable. An example: 49*06c3fb27SDimitry Andric ... 50*06c3fb27SDimitry Andric from lldbutil import get_ESRs 51*06c3fb27SDimitry Andric regs = get_ESRs(frame) 52*06c3fb27SDimitry Andric for reg in regs: 53*06c3fb27SDimitry Andric print('%s => %s' % (reg.GetName(), reg.GetValue())) 54*06c3fb27SDimitry Andric ... 55*06c3fb27SDimitry Andric ''' 56*06c3fb27SDimitry Andric return get_registers(frame, 'exception state') 57*06c3fb27SDimitry Andric " 58*06c3fb27SDimitry Andric ) lldb::SBValueList; 59