diff options
Diffstat (limited to 'lldb/include/lldb/API/SBValue.h')
-rw-r--r-- | lldb/include/lldb/API/SBValue.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index e4d4f5090d0..40a461285b2 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -18,7 +18,47 @@ namespace lldb { #ifdef SWIG %feature("docstring", - "Represents the value of a variable, a register, or an expression." +"Represents the value of a variable, a register, or an expression. + +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 +frame as an SBValue, and iterate through all the registers, + + registerSet = frame.GetRegisters() # Returns an SBValueList. + for regs in registerSet: + if 'general purpose registers' in regs.getName().lower(): + GPRs = regs + break + + print '%s (number of children = %d):' % (GPRs.GetName(), GPRs.GetNumChildren()) + for reg in GPRs: + print 'Name: ', reg.GetName(), ' Value: ', reg.GetValue() + +produces the output: + +General Purpose Registers (number of children = 21): +Name: rax Value: 0x0000000100000c5c +Name: rbx Value: 0x0000000000000000 +Name: rcx Value: 0x00007fff5fbffec0 +Name: rdx Value: 0x00007fff5fbffeb8 +Name: rdi Value: 0x0000000000000001 +Name: rsi Value: 0x00007fff5fbffea8 +Name: rbp Value: 0x00007fff5fbffe80 +Name: rsp Value: 0x00007fff5fbffe60 +Name: r8 Value: 0x0000000008668682 +Name: r9 Value: 0x0000000000000000 +Name: r10 Value: 0x0000000000001200 +Name: r11 Value: 0x0000000000000206 +Name: r12 Value: 0x0000000000000000 +Name: r13 Value: 0x0000000000000000 +Name: r14 Value: 0x0000000000000000 +Name: r15 Value: 0x0000000000000000 +Name: rip Value: 0x0000000100000dae +Name: rflags Value: 0x0000000000000206 +Name: cs Value: 0x0000000000000027 +Name: fs Value: 0x0000000000000010 +Name: gs Value: 0x0000000000000048 +" ) SBValue; #endif class SBValue |