Advertisement
Guest User

Untitled

a guest
Feb 15th, 2015
287
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ lldb ./a.out pg1777.txt
  2. (lldb) target create "./a.out"
  3. Current executable set to './a.out' (x86_64).
  4. (lldb) settings set -- target.run-args "pg1777.txt"
  5. (lldb) breakpoint set -n find_word
  6. Breakpoint 1: where = a.out`find_word + 16 at dictionary.c:126, address = 0x0000000100000a90
  7. (lldb) r
  8. Process 43468 launched: './a.out' (x86_64)
  9. Dictionary loaded.
  10. Enter search word: Romeo
  11. Process 43468 stopped
  12. * 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
  13. frame #0: 0x0000000100000a90 a.out`find_word(dictionary=0x0000000100104ba0, word=0x00007fff5fbff490) + 16 at dictionary.c:126
  14. 123 int
  15. 124 find_word (tree_node *dictionary, char *word)
  16. 125 {
  17. -> 126 if (!word || !dictionary)
  18. 127 return 0;
  19. 128
  20. 129 int compare_value = strcmp (word, dictionary->word);
  21. (lldb) script
  22. Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
  23. >>> import tree_utils
  24. >>> root = lldb.frame.FindVariable ("dictionary")
  25. >>> current_path = ""
  26. >>> path = tree_utils.DFS (root, "Romeo", current_path)
  27. >>> print path
  28. LRRLRLRLR
  29. >>> path = tree_utils.DFS (root, "romeo", current_path)
  30. Traceback (most recent call last):
  31. File "<console>", line 1, in <module>
  32. File "./tree_utils.py", line 77, in DFS
  33. return DFS (right_child_ptr, word, cur_path)
  34. File "./tree_utils.py", line 77, in DFS
  35. return DFS (right_child_ptr, word, cur_path)
  36. File "./tree_utils.py", line 77, in DFS
  37. return DFS (right_child_ptr, word, cur_path)
  38. File "./tree_utils.py", line 77, in DFS
  39. return DFS (right_child_ptr, word, cur_path)
  40. File "./tree_utils.py", line 67, in DFS
  41. return DFS (left_child_ptr, word, cur_path)
  42. File "./tree_utils.py", line 67, in DFS
  43. return DFS (left_child_ptr, word, cur_path)
  44. File "./tree_utils.py", line 67, in DFS
  45. return DFS (left_child_ptr, word, cur_path)
  46. File "./tree_utils.py", line 77, in DFS
  47. return DFS (right_child_ptr, word, cur_path)
  48. File "./tree_utils.py", line 67, in DFS
  49. return DFS (left_child_ptr, word, cur_path)
  50. File "./tree_utils.py", line 67, in DFS
  51. return DFS (left_child_ptr, word, cur_path)
  52. File "./tree_utils.py", line 67, in DFS
  53. return DFS (left_child_ptr, word, cur_path)
  54. File "./tree_utils.py", line 67, in DFS
  55. return DFS (left_child_ptr, word, cur_path)
  56. File "./tree_utils.py", line 67, in DFS
  57. return DFS (left_child_ptr, word, cur_path)
  58. File "./tree_utils.py", line 77, in DFS
  59. return DFS (right_child_ptr, word, cur_path)
  60. File "./tree_utils.py", line 77, in DFS
  61. return DFS (right_child_ptr, word, cur_path)
  62. File "./tree_utils.py", line 77, in DFS
  63. return DFS (right_child_ptr, word, cur_path)
  64. File "./tree_utils.py", line 67, in DFS
  65. return DFS (left_child_ptr, word, cur_path)
  66. File "./tree_utils.py", line 67, in DFS
  67. return DFS (left_child_ptr, word, cur_path)
  68. File "./tree_utils.py", line 67, in DFS
  69. return DFS (left_child_ptr, word, cur_path)
  70. File "./tree_utils.py", line 77, in DFS
  71. return DFS (right_child_ptr, word, cur_path)
  72. File "./tree_utils.py", line 67, in DFS
  73. return DFS (left_child_ptr, word, cur_path)
  74. File "./tree_utils.py", line 77, in DFS
  75. return DFS (right_child_ptr, word, cur_path)
  76. File "./tree_utils.py", line 77, in DFS
  77. return DFS (right_child_ptr, word, cur_path)
  78. File "./tree_utils.py", line 77, in DFS
  79. return DFS (right_child_ptr, word, cur_path)
  80. File "./tree_utils.py", line 77, in DFS
  81. return DFS (right_child_ptr, word, cur_path)
  82. File "./tree_utils.py", line 47, in DFS
  83. end = len (root_word) - 1
  84. TypeError: object of type 'NoneType' has no len()
  85. >>>
Advertisement
RAW Paste Data Copied
Advertisement