summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-08-05 20:48:02 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-08-05 20:48:02 +0000
commit9b97f1c3e624917d86b188c37b937a597cc807b3 (patch)
tree138d91414d8235def748fe548f49c2752bd9769b /lldb/scripts/Python/interface
parentf0c95cadc7a1499e5449ae2aa5335f4ca29e46ed (diff)
downloadbcm5719-llvm-9b97f1c3e624917d86b188c37b937a597cc807b3.tar.gz
bcm5719-llvm-9b97f1c3e624917d86b188c37b937a597cc807b3.zip
Add docstring & example usage for SBTypeList.
llvm-svn: 136979
Diffstat (limited to 'lldb/scripts/Python/interface')
-rw-r--r--lldb/scripts/Python/interface/SBType.i31
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i
index 88fc7a3de63..1936c04039f 100644
--- a/lldb/scripts/Python/interface/SBType.i
+++ b/lldb/scripts/Python/interface/SBType.i
@@ -47,6 +47,37 @@ public:
GetName();
};
+%feature("docstring",
+"Represents a list of SBTypes. The FindTypes() method of SBTarget/SBModule
+returns a SBTypeList.
+
+SBTypeList supports SBType iteration. For example,
+
+main.cpp:
+
+class Task {
+public:
+ int id;
+ Task *next;
+ Task(int i, Task *n):
+ id(i),
+ next(n)
+ {}
+};
+
+...
+
+find_type.py:
+
+ # Get the type 'Task'.
+ type_list = target.FindTypes('Task')
+ self.assertTrue(len(type_list) == 1)
+ # To illustrate the SBType iteration.
+ for type in type_list:
+ # do something with type
+
+...
+") SBTypeList;
class SBTypeList
{
public:
OpenPOWER on IntegriCloud