Detaching Gdb without resuming the inferior
<p>Gdb, like any other program, isn't perfect, and every now and then I encounter bugs that render the current Gdb instance unusable. At this point, if I have a debugging session with a lot of valuable state in the inferior, I'd like to be able to just start a new Gdb session on it. That is, detach, quit Gdb and start a new Gdb instance to restart where I left off.</p>

<p>However, when detaching Gdb, it resumes the inferior so that it continues running where it was, which ruins the point of the whole exercise. Therefore, I'm wondering if it's possible to detach in such a state that the inferior is as if it had been sent a <code>SIGSTOP</code>, basically.</p>

<p>I've tried simply killing Gdb, but interestingly, that seems to take the inferior with it. Not sure how that works.</p>