diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-08-11 00:49:03 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-08-11 00:49:03 +0000 |
commit | 9c1b703ac45a04633ef612eb346b99120964ee53 (patch) | |
tree | 33be02ea7014be7e8ad1383890fc0b3d9d617e7b /lldb/scripts/Python/modify-python-lldb.py | |
parent | 3c24a17c7cc51bce90993a783019c5899c205bc4 (diff) | |
download | llvm-9c1b703ac45a04633ef612eb346b99120964ee53.zip llvm-9c1b703ac45a04633ef612eb346b99120964ee53.tar.gz llvm-9c1b703ac45a04633ef612eb346b99120964ee53.tar.bz2 |
Change the SBValue.linked_list_iter() to treat the value object as a homogeneous linked list data structure
where an empty linked list is represented as a value object with a NULL value, instead of a special value
object which 'points' to NULL.
Also modifies the test case to comply.
rdar://problem/9933692
llvm-svn: 137289
Diffstat (limited to 'lldb/scripts/Python/modify-python-lldb.py')
-rw-r--r-- | lldb/scripts/Python/modify-python-lldb.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/scripts/Python/modify-python-lldb.py b/lldb/scripts/Python/modify-python-lldb.py index 8a0edd7..a6e86c2 100644 --- a/lldb/scripts/Python/modify-python-lldb.py +++ b/lldb/scripts/Python/modify-python-lldb.py @@ -95,7 +95,7 @@ linked_list_iter_def = ''' Return True if val is invalid or it corresponds to a null pointer. Otherwise, return False. """ - if not val or int(val.GetValue(), 0) == 0: + if not val or val.GetValueAsUnsigned() == 0: return True else: return False @@ -127,8 +127,10 @@ linked_list_iter_def = ''' for t in task_head.linked_list_iter('next'): print t """ + if end_of_list_test(self): + return + item = self try: - item = self.GetChildMemberWithName(next_item_name) while not end_of_list_test(item): yield item # Prepare for the next iteration. |