Debugger/Windows: Do not attach to process being debugged.

Reviewed-by: Robert Loehning <robert.loehning@nokia.com>
Task-number: QTCREATORBUG-2086
This commit is contained in:
Friedemann Kleint
2010-10-22 14:03:25 +02:00
parent c7e47f53bc
commit 1f09c6bc45
4 changed files with 30 additions and 0 deletions

View File

@@ -242,5 +242,16 @@ QString winNormalizeFileName(const QString &f)
return rc.isEmpty() ? f : rc;
}
bool isWinProcessBeingDebugged(unsigned long pid)
{
HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
if (processHandle == NULL)
return false;
BOOL debugged = FALSE;
CheckRemoteDebuggerPresent(processHandle, &debugged);
CloseHandle(processHandle);
return debugged != FALSE;
}
} // namespace Internal
} // namespace Debugger