Skip to content
Snippets Groups Projects
Commit 9144cb24 authored by hjk's avatar hjk Committed by Kai Koehne
Browse files

debugger: implement direct interrupt of the gdb process on windows


Change-Id: I1882f1a49cca84456e9f94e608308d2c571fed67
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 696dd9a7
No related branches found
No related tags found
No related merge requests found
...@@ -32,14 +32,16 @@ ...@@ -32,14 +32,16 @@
#include "localgdbprocess.h" #include "localgdbprocess.h"
#include <utils/qtcassert.h> #include "procinterrupt.h"
#include "debuggerconstants.h"
#ifdef Q_OS_UNIX #ifdef Q_OS_WIN
#include <errno.h> #include <utils/winutils.h>
#include <signal.h>
#include <string.h>
#endif #endif
#include <utils/qtcassert.h>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
...@@ -87,16 +89,13 @@ void LocalGdbProcess::kill() ...@@ -87,16 +89,13 @@ void LocalGdbProcess::kill()
bool LocalGdbProcess::interrupt() bool LocalGdbProcess::interrupt()
{ {
#ifdef Q_OS_UNIX long pid;
Q_PID pid = m_gdbProc.pid(); #ifdef Q_OS_WIN
int res = ::kill(pid, SIGINT); pid = Utils::winQPidToPid(m_gdbProc.pid());
if (res != 0)
m_errorString = QString::fromLocal8Bit(strerror(errno));
return res == 0;
#else #else
QTC_ASSERT(false, "NOT IMPLEMENTED"); pid = m_gdbProc.pid();
return false;
#endif #endif
return interruptProcess(pid, GdbEngineType, &m_errorString);
} }
QProcess::ProcessState LocalGdbProcess::state() const QProcess::ProcessState LocalGdbProcess::state() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment