1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
| $ lldb main (lldb) target create "main" Current executable set to 'main' (x86_64). (lldb) b task_set_exception_ports Breakpoint 1: where = libsystem_kernel.dylib`task_set_exception_ports, address = 0x000000000000c599 (lldb) r Process 20547 launched: '.../main' (x86_64) Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x00007fff54841599 libsystem_kernel.dylib`task_set_exception_ports libsystem_kernel.dylib`task_set_exception_ports: -> 0x7fff54841599 <+0>: pushq %rbp 0x7fff5484159a <+1>: movq %rsp, %rbp 0x7fff5484159d <+4>: pushq %rbx 0x7fff5484159e <+5>: subq $0x48, %rsp Target 0: (main) stopped. (lldb) reg w rsi 0 (lldb) fin Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step out frame #0: 0x0000000100000e22 main`remove_debugger + 194 main`remove_debugger: -> 0x100000e22 <+194>: movl %eax, -0xc(%rbp) 0x100000e25 <+197>: cmpl $0x0, -0xc(%rbp) 0x100000e29 <+201>: je 0x100000e57 ; <+247> 0x100000e2f <+207>: movl -0xc(%rbp), %edi Target 0: (main) stopped. (lldb) fin Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step out frame #0: 0x0000000100000e8b main`main + 27 main`main: -> 0x100000e8b <+27>: cmpl $0x0, %eax 0x100000e8e <+30>: je 0x100000eb1 ; <+65> 0x100000e94 <+36>: leaq 0xe9(%rip), %rdi ; "Error\n" 0x100000e9b <+43>: movb $0x0, %al Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000e8e main`main + 30 main`main: -> 0x100000e8e <+30>: je 0x100000eb1 ; <+65> 0x100000e94 <+36>: leaq 0xe9(%rip), %rdi ; "Error\n" 0x100000e9b <+43>: movb $0x0, %al 0x100000e9d <+45>: callq 0x100000ee4 ; symbol stub for: printf Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000eb1 main`main + 65 main`main: -> 0x100000eb1 <+65>: leaq 0xd3(%rip), %rdi ; "No debugger currently attached\n" 0x100000eb8 <+72>: movb $0x0, %al 0x100000eba <+74>: callq 0x100000ee4 ; symbol stub for: printf 0x100000ebf <+79>: movl $0x0, -0x4(%rbp) Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000eb8 main`main + 72 main`main: -> 0x100000eb8 <+72>: movb $0x0, %al 0x100000eba <+74>: callq 0x100000ee4 ; symbol stub for: printf 0x100000ebf <+79>: movl $0x0, -0x4(%rbp) 0x100000ec6 <+86>: movl %eax, -0x18(%rbp) Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000eba main`main + 74 main`main: -> 0x100000eba <+74>: callq 0x100000ee4 ; symbol stub for: printf 0x100000ebf <+79>: movl $0x0, -0x4(%rbp) 0x100000ec6 <+86>: movl %eax, -0x18(%rbp) 0x100000ec9 <+89>: movl -0x4(%rbp), %eax Target 0: (main) stopped. (lldb) ni No debugger currently attached Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ebf main`main + 79 main`main: -> 0x100000ebf <+79>: movl $0x0, -0x4(%rbp) 0x100000ec6 <+86>: movl %eax, -0x18(%rbp) 0x100000ec9 <+89>: movl -0x4(%rbp), %eax 0x100000ecc <+92>: addq $0x20, %rsp Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ec6 main`main + 86 main`main: -> 0x100000ec6 <+86>: movl %eax, -0x18(%rbp) 0x100000ec9 <+89>: movl -0x4(%rbp), %eax 0x100000ecc <+92>: addq $0x20, %rsp 0x100000ed0 <+96>: popq %rbp Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ec9 main`main + 89 main`main: -> 0x100000ec9 <+89>: movl -0x4(%rbp), %eax 0x100000ecc <+92>: addq $0x20, %rsp 0x100000ed0 <+96>: popq %rbp 0x100000ed1 <+97>: retq Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ecc main`main + 92 main`main: -> 0x100000ecc <+92>: addq $0x20, %rsp 0x100000ed0 <+96>: popq %rbp 0x100000ed1 <+97>: retq
main`mach_error_string: 0x100000ed2 <+0>: jmpq *0x140(%rip) ; (void *)0x0000000100000f00 Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ed0 main`main + 96 main`main: -> 0x100000ed0 <+96>: popq %rbp 0x100000ed1 <+97>: retq
main`mach_error_string: 0x100000ed2 <+0>: jmpq *0x140(%rip) ; (void *)0x0000000100000f00
main`mach_port_allocate: 0x100000ed8 <+0>: jmpq *0x142(%rip) ; (void *)0x00007fff54850302: mach_port_allocate Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100000ed1 main`main + 97 main`main: -> 0x100000ed1 <+97>: retq
main`mach_error_string: 0x100000ed2 <+0>: jmpq *0x140(%rip) ; (void *)0x0000000100000f00
main`mach_port_allocate: 0x100000ed8 <+0>: jmpq *0x142(%rip) ; (void *)0x00007fff54850302: mach_port_allocate
main`mach_port_insert_right: 0x100000ede <+0>: jmpq *0x144(%rip) ; (void *)0x00007fff54850434: mach_port_insert_right Target 0: (main) stopped. (lldb) ni Process 20547 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x00007fff54701015 libdyld.dylib`start + 1 libdyld.dylib`start: -> 0x7fff54701015 <+1>: movl %eax, %edi 0x7fff54701017 <+3>: callq 0x7fff547194c4 ; symbol stub for: exit 0x7fff5470101c <+8>: hlt
libdyld.dylib`dyld3::kdebug_trace_dyld_image: 0x7fff5470101d <+0>: pushq %rbp Target 0: (main) stopped. (lldb) c Process 20547 resuming Process 20547 exited with status = 0 (0x00000000) (lldb)
|
Comments