[Lldb-commits] [lldb] r136979 - /lldb/trunk/scripts/Python/interface/SBType.i
Johnny Chen
johnny.chen at apple.com
Fri Aug 5 13:48:02 PDT 2011
Author: johnny
Date: Fri Aug 5 15:48:02 2011
New Revision: 136979
URL: http://llvm.org/viewvc/llvm-project?rev=136979&view=rev
Log:
Add docstring & example usage for SBTypeList.
Modified:
lldb/trunk/scripts/Python/interface/SBType.i
Modified: lldb/trunk/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBType.i?rev=136979&r1=136978&r2=136979&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBType.i (original)
+++ lldb/trunk/scripts/Python/interface/SBType.i Fri Aug 5 15:48:02 2011
@@ -47,6 +47,37 @@
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:
More information about the lldb-commits
mailing list