Is there a way to make gdb share ptrace with another process?
<p>I need to run another process that needs to ptrace() its inferior. But also gdb needs to ptrace() the same inferior as well, so this will lead to chaos.</p>
<p>The first and obvious solution that came to my mind was to detach the gdb whenever the other process needs to access the inferior and then attach again. However, this is also problematic when the inferior is stopped for debugging.</p>
<p>Then I tried to launch the other process from gdb using gdb's <code>shell</code> command thinking maybe it can work if gdb executes the other process as its child. But even when gdb executes it as a child, they'll have different PIDs, so the problem still continues.</p>
<p>Is it possible to make gdb and the other process look like they share the same PID so they can attach to the same inferior?</p>