This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demonstrate on-demand ptrace() of a single thread, not affecting any other | |
// thread in the process. The Linux/x86-64 version. | |
// | |
// This differs from ptrace() examples I could find on the Web by: | |
// * Tracing the parent process from the child (same as Crashpad) | |
// * Allowing to run threads in the background | |
// | |
// This is just a *demo*. A lot of error situations are not checked for, same | |
// for process states (wrt to signals, for example). Uses the mix of | |
// fork(2)+threads and malloc() in the forked process. Uses pipe() for message |