aboutsummaryrefslogtreecommitdiff
path: root/lldb/scripts/Python/modify-python-lldb.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-26 20:20:13 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-26 20:20:13 +0000
commit6b092e821b718a57fdb9b9d3d117206b008d885f (patch)
tree074e0aacb093ce15ed1fe8fa1f05bb12266a161b /lldb/scripts/Python/modify-python-lldb.py
parent11346d313669355a8ec15175292bcb244f2a2475 (diff)
downloadllvm-6b092e821b718a57fdb9b9d3d117206b008d885f.zip
llvm-6b092e821b718a57fdb9b9d3d117206b008d885f.tar.gz
llvm-6b092e821b718a57fdb9b9d3d117206b008d885f.tar.bz2
The test function to determine whether we have reached the end of the list was
too complex in the test case. We can just simply test that the SBValue object is a valid object and it does not correspond to a null pointer in order to say that EOL has not been reached. Modify the test case and the lldb.py docstring to have a more compact test function. llvm-svn: 136123
Diffstat (limited to 'lldb/scripts/Python/modify-python-lldb.py')
-rw-r--r--lldb/scripts/Python/modify-python-lldb.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/lldb/scripts/Python/modify-python-lldb.py b/lldb/scripts/Python/modify-python-lldb.py
index 6f211b2..3a784a6 100644
--- a/lldb/scripts/Python/modify-python-lldb.py
+++ b/lldb/scripts/Python/modify-python-lldb.py
@@ -103,22 +103,15 @@ linked_list_iter_def = '''
For example,
- # Test function to determine end of list.
def eol(val):
- if not val:
+ \'\'\'Test function to determine end of list.\'\'\'
+ # End of list is reached if either the value object is invalid
+ # or it corresponds to a null pointer.
+ if not val or int(val.GetValue(), 16) == 0:
return True
- try:
- # Test the semantics of the item we got.
- id = val.GetChildMemberWithName("id")
- if int(id.GetValue()) > 0:
- return False
- except:
- pass
-
- # If we fall through to here. It could be that exception
- # occurred or the "id" child member does not qualify as a
- # valid item. Return True for EOL.
- return True
+
+ # Otherwise, return False.
+ return False
# Get Frame #0.
...