[Lldb-commits] [lldb] r136015 - in /lldb/trunk/scripts/Python: interface/SBValue.i modify-python-lldb.py

Johnny Chen johnny.chen at apple.com
Mon Jul 25 16:41:08 PDT 2011


Author: johnny
Date: Mon Jul 25 18:41:08 2011
New Revision: 136015

URL: http://llvm.org/viewvc/llvm-project?rev=136015&view=rev
Log:
Add cross references between the docstrings for regular SBValue iteration:

    for child in value:
        # do something with the child value

and SBValue.linked_list_iter():

    for task in task_head.linked_list_iter('next', eol_test):
        # visit each item in the linked list

Modified:
    lldb/trunk/scripts/Python/interface/SBValue.i
    lldb/trunk/scripts/Python/modify-python-lldb.py

Modified: lldb/trunk/scripts/Python/interface/SBValue.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBValue.i?rev=136015&r1=136014&r2=136015&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBValue.i (original)
+++ lldb/trunk/scripts/Python/interface/SBValue.i Mon Jul 25 18:41:08 2011
@@ -49,7 +49,11 @@
 Name:  rflags  Value:  0x0000000000000206
 Name:  cs  Value:  0x0000000000000027
 Name:  fs  Value:  0x0000000000000010
-Name:  gs  Value:  0x0000000000000048"
+Name:  gs  Value:  0x0000000000000048
+
+See also linked_list_iter() for another perspective on how to iterate through an
+SBValue instance which interprets the value object as representing the head of a
+linked list."
 ) SBValue;
 class SBValue
 {

Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=136015&r1=136014&r2=136015&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Mon Jul 25 18:41:08 2011
@@ -83,17 +83,23 @@
 '''
 
 #
-# linked_list_iter() is a special purpose iterator to treat the SBValue as a
-# list data structure, where you specify the child member name which points to
-# the next item on the list and you specify the end-of-list function which takes
-# an SBValue and returns True if EOL is reached and False if not.
+# linked_list_iter() is a special purpose iterator to treat the SBValue as the
+# head of a list data structure, where you specify the child member name which
+# points to the next item on the list and you specify the end-of-list function
+# which takes an SBValue and returns True if EOL is reached and False if not.
 #
 linked_list_iter_def = '''
     # ==================================================
     # Iterator for lldb.SBValue treated as a linked list
     # ==================================================
     def linked_list_iter(self, next_item_name, end_of_list):
-        """A generator adaptor to support iteration for SBValue as a linked list.
+        """Generator adaptor to support iteration for SBValue as a linked list.
+
+        linked_list_iter() is a special purpose iterator to treat the SBValue as
+        the head of a list data structure, where you specify the child member
+        name which points to the next item on the list and you specify the
+        end-of-list test function which takes an SBValue for an item and returns
+        True if EOL is reached and False if not.
 
         For example,
 





More information about the lldb-commits mailing list