Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ lldb ./a.out pg1777.txt
- (lldb) target create "./a.out"
- Current executable set to './a.out' (x86_64).
- (lldb) settings set -- target.run-args "pg1777.txt"
- (lldb) breakpoint set -n find_word
- Breakpoint 1: where = a.out`find_word + 16 at dictionary.c:126, address = 0x0000000100000a90
- (lldb) r
- Process 43468 launched: './a.out' (x86_64)
- Dictionary loaded.
- Enter search word: Romeo
- Process 43468 stopped
- * thread #1: tid = 0x3576e0, 0x0000000100000a90 a.out`find_word(dictionary=0x0000000100104ba0, word=0x00007fff5fbff490) + 16 at dictionary.c:126, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
- frame #0: 0x0000000100000a90 a.out`find_word(dictionary=0x0000000100104ba0, word=0x00007fff5fbff490) + 16 at dictionary.c:126
- 123 int
- 124 find_word (tree_node *dictionary, char *word)
- 125 {
- -> 126 if (!word || !dictionary)
- 127 return 0;
- 128
- 129 int compare_value = strcmp (word, dictionary->word);
- (lldb) script
- Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
- >>> import tree_utils
- >>> root = lldb.frame.FindVariable ("dictionary")
- >>> current_path = ""
- >>> path = tree_utils.DFS (root, "Romeo", current_path)
- >>> print path
- LRRLRLRLR
- >>> path = tree_utils.DFS (root, "romeo", current_path)
- Traceback (most recent call last):
- File "<console>", line 1, in <module>
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 67, in DFS
- return DFS (left_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 77, in DFS
- return DFS (right_child_ptr, word, cur_path)
- File "./tree_utils.py", line 47, in DFS
- end = len (root_word) - 1
- TypeError: object of type 'NoneType' has no len()
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement