0

From the output of strace -o file lldb someprog, I found there is no ptrace.

Then how can lldb get features like PTRACE_ATTACH/PTRACE_SINGLESTEP and so on?

Chen Li
  • 4,824
  • 3
  • 28
  • 55

1 Answers1

1

Ironically, the lldb process doesn't do any actual debugging. Instead, it always uses a proxy (lldb-server on Linux, debugserver on Darwin)(*) to do the actual debugging, and communicates with it using the gdb remote serial protocol. lldb-server does use ptrace on Linux (and somewhat on Darwin).

(*) I think there still is an in-process adaptor for Windows, but IIRC they are switching to lldb-server as well.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63