alansam

hw43 debug session.

Feb 27th, 2020
172
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ lldb ../../bin/hw43
  2. (lldb) target create "../../bin/hw43"
  3. Current executable set to '../../bin/hw43' (x86_64).
  4. (lldb) l
  5. 5 int main(int argc, char const * argv[]) {
  6. 6
  7. 7 int a = 0;
  8. 8 int b;
  9. 9 int c = 0;
  10. 10
  11. 11 printf("a=%p b=%p c=%p\n", &a, &b, &c);
  12. 12
  13. 13 return 0;
  14. 14 }
  15. (lldb) breakpoint set --file hw43.c --line 7
  16. Breakpoint 1: where = hw43`main + 15 at hw43.c:7:7, address = 0x0000000100000f49
  17. (lldb) breakpoint set --file hw43.c --line 9
  18. Breakpoint 2: where = hw43`main + 22 at hw43.c:9:7, address = 0x0000000100000f50
  19. (lldb) breakpoint set --file hw43.c --line 13
  20. Breakpoint 3: where = hw43`main + 61 at hw43.c:13:10, address = 0x0000000100000f77
  21. (lldb) process launch
  22. Process 42721 launched: '/XXXX/bin/hw43' (x86_64)
  23. Process 42721 stopped
  24. * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  25. frame #0: 0x0000000100000f49 hw43`main(argc=1, argv=0x00007ffeefbff3f8) at hw43.c:7:7
  26. 4
  27. 5 int main(int argc, char const * argv[]) {
  28. 6
  29. -> 7 int a = 0;
  30. 8 int b;
  31. 9 int c = 0;
  32. 10
  33. Target 0: (hw43) stopped.
  34. (lldb) frame variable
  35. (int) argc = 1
  36. (const char **) argv = 0x00007ffeefbff3f8
  37. (int) a = 1
  38. (int) b = 20517
  39. (int) c = 32766
  40. (lldb) continue
  41. Process 42721 resuming
  42. Process 42721 stopped
  43. * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  44. frame #0: 0x0000000100000f50 hw43`main(argc=1, argv=0x00007ffeefbff3f8) at hw43.c:9:7
  45. 6
  46. 7 int a = 0;
  47. 8 int b;
  48. -> 9 int c = 0;
  49. 10
  50. 11 printf("a=%p b=%p c=%p\n", &a, &b, &c);
  51. 12
  52. Target 0: (hw43) stopped.
  53. (lldb) frame variable
  54. (int) argc = 1
  55. (const char **) argv = 0x00007ffeefbff3f8
  56. (int) a = 0
  57. (int) b = 20517
  58. (int) c = 32766
  59. (lldb) continue
  60. Process 42721 resuming
  61. a=0x7ffeefbff3cc b=0x7ffeefbff3c8 c=0x7ffeefbff3c4
  62. Process 42721 stopped
  63. * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1
  64. frame #0: 0x0000000100000f77 hw43`main(argc=1, argv=0x00007ffeefbff3f8) at hw43.c:13:10
  65. 10
  66. 11 printf("a=%p b=%p c=%p\n", &a, &b, &c);
  67. 12
  68. -> 13 return 0;
  69. 14 }
  70. 15
  71. Target 0: (hw43) stopped.
  72. (lldb) frame variable
  73. (int) argc = 1
  74. (const char **) argv = 0x00007ffeefbff3f8
  75. (int) a = 0
  76. (int) b = 20517
  77. (int) c = 0
  78. (lldb) continue
  79. Process 42721 resuming
  80. Process 42721 exited with status = 0 (0x00000000)
  81. (lldb) quit
RAW Paste Data