Fixed a typo in the example (getName -> GetName)

but while I was at it I converted the example to use
properties, since that's much nicer looking.

llvm-svn: 311679
This commit is contained in:
Jim Ingham 2017-08-24 18:01:50 +00:00
parent 6aedf785c5
commit 44ea319596

View File

@ -16,15 +16,15 @@ SBValue supports iteration through its child, which in turn is represented
as an SBValue. For example, we can get the general purpose registers of a as an SBValue. For example, we can get the general purpose registers of a
frame as an SBValue, and iterate through all the registers, frame as an SBValue, and iterate through all the registers,
registerSet = frame.GetRegisters() # Returns an SBValueList. registerSet = frame.registers # Returns an SBValueList.
for regs in registerSet: for regs in registerSet:
if 'general purpose registers' in regs.getName().lower(): if 'general purpose registers' in regs.name.lower():
GPRs = regs GPRs = regs
break break
print('%s (number of children = %d):' % (GPRs.GetName(), GPRs.GetNumChildren())) print('%s (number of children = %d):' % (GPRs.name, GPRs.num_children))
for reg in GPRs: for reg in GPRs:
print('Name: ', reg.GetName(), ' Value: ', reg.GetValue()) print('Name: ', reg.name, ' Value: ', reg.value)
produces the output: produces the output: