forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user