I'm really new on LLDB. I'm trying to figure out why my C application sometimes breaks on a segmentation fault.
I've compiled my application with -g and started lldb pointing to the binary. So I ran the app with "run" code and when it crashes, LLDB shows me the message:
* thread #1: tid = 0x8817, 0x00007fffae0feb52 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fffae0feb52 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
-> 0x7fffae0feb52 <+18>: pcmpeqb (%rdi), %xmm0
0x7fffae0feb56 <+22>: pmovmskb %xmm0, %esi
0x7fffae0feb5a <+26>: andq $0xf, %rcx
0x7fffae0feb5e <+30>: orq $-0x1, %rax
I saw a "tutorial" where the person did the same thing as me, but for him LLDB showed his C source code and pointed the line where it crashed. For me I can only see this hex with assembly that I cannot trace.
What am I doing wrong?
Thank you guys.
EDIT:
Forgot to say that my app is only printing c* chars on terminal each second. Sometimes it take a few minutes to crash, sometimes it crashes after hours.