/* Discard the in-flight notification. */
if (reply != NULL && reply->ptid.pid () == inf->pid)
That is always moving the stop reply from pending_event, when we only
really want to peek into it. The code further below that even says:
/* Discard the in-flight notification. */
if (reply != NULL && reply->ptid.pid () == inf->pid)
{
/* Leave the notification pending, since the server expects that
we acknowledge it with vStopped. But clear its contents, so
that later on when we acknowledge it, we also discard it. */
This commit reverts that hunk back, adjusted to use unique_ptr::get().