mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-04 06:51:56 +00:00
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:
parent
6aedf785c5
commit
44ea319596
@ -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:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user