0xSina
0xSina

Reputation: 21553

gdb attaching process causes mach_msg_trap ()

I am just starting out with gdb so I got a CrackMe application I am trying to debug. So I ran the application, fired up gdb in terminal and attached it to CrackMe's PID and it crashed the application.

(gdb) attach 6040
Attaching to program: `/Users/***/Desktop/CrackMe.app/Contents/MacOS/CrackMe', process 6040.
Reading symbols for shared libraries + done
Re-enabling shared library breakpoint 1
Re-enabling shared library breakpoint 2
0x00007fff8428767a in mach_msg_trap ()

And after this, the program becomes unresponsive. Is there so other argument that I need to pass to attach that I am missing? Thanks

Upvotes: 0

Views: 618

Answers (1)

Ken Thomases
Ken Thomases

Reputation: 90521

When you attach with the debugger, it automatically stops the program. That's why it's unresponsive. Type "cont" (or "continue") to let it keep going.

It's also showing you the top frame of the stack, where it has stopped. That's mach_msg_trap() in this case. That's a very common case, because an idle app will often be blocked in that function as it waits for events from the window server.

Upvotes: 1

Related Questions