hornet: Add "-P pid" flag to stop process using ptrace

Picking instruction addresses inside running processes is rather
hit or miss. We may pick an address for injection that is never
executed.

Using ptrace(2) to stop the process we can find the precise address
of the next instruction to be executed and thus guarantee that we
will immediately hit the injected address when we resume running the
process.

Signed-off-by: Jin Wen <wenx.jin@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2 files changed