summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-15 00:27:47 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-15 00:27:47 +0000
commit3d3a7cf563ce8cd8d6602035775b26c3d3ffbba5 (patch)
tree1e14ca2ad0053233649125d87fd922eeb5971328
parent56498d167ae7e0c2f8f3309742c87d24efca8e62 (diff)
downloadbcm5719-llvm-3d3a7cf563ce8cd8d6602035775b26c3d3ffbba5.tar.gz
bcm5719-llvm-3d3a7cf563ce8cd8d6602035775b26c3d3ffbba5.zip
Add usage docstring to SBValue.h, and minor update of docstrings for SBValueList.h.
llvm-svn: 135230
-rwxr-xr-xlldb/examples/python/disasm.py2
-rw-r--r--lldb/include/lldb/API/SBValue.h42
-rw-r--r--lldb/include/lldb/API/SBValueList.h2
3 files changed, 43 insertions, 3 deletions
diff --git a/lldb/examples/python/disasm.py b/lldb/examples/python/disasm.py
index 67a7c6dcc80..732cf106b11 100755
--- a/lldb/examples/python/disasm.py
+++ b/lldb/examples/python/disasm.py
@@ -95,7 +95,7 @@ if target:
#print value
print "%s (number of children = %d):" % (value.GetName(), value.GetNumChildren())
for child in value:
- print "Name: ", child.GetName(), " Value: ", child.GetValue(frame)
+ print "Name: ", child.GetName(), " Value: ", child.GetValue()
print "Hit the breakpoint at main, enter to continue and wait for program to exit or 'Ctrl-D'/'quit' to terminate the program"
next = sys.stdin.readline()
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
diff --git a/lldb/include/lldb/API/SBValueList.h b/lldb/include/lldb/API/SBValueList.h
index 364ed91ee8a..2cff8a72649 100644
--- a/lldb/include/lldb/API/SBValueList.h
+++ b/lldb/include/lldb/API/SBValueList.h
@@ -19,7 +19,7 @@ namespace lldb {
"Represents a collection of SBValues. Both SBFrame's GetVariables() and
GetRegisters() return a SBValueList.
-For example (from test/lldbutil.py),
+SBValueList supports SBValue iteration. For example (from test/lldbutil.py),
def get_registers(frame, kind):
'''Returns the registers given the frame and the kind of registers desired.
OpenPOWER on IntegriCloud