How to use PTRACE to get a consistent view of multiple threads?
问题 While I was working on this question, I've come across a possible idea that uses ptrace , but I'm unable to get a proper understanding of how ptrace interacts with threads. Suppose I have a given, multithreaded main process, and I want to attach to a specific thread in it (perhaps from a forked child). Can I attach to a specific thread? (The manuals diverge on this question.) If so, does that mean that single-stepping only steps through that one thread's instructions? Does it stop all the