forked from qt-creator/qt-creator
debugger: implement direct interrupt of the gdb process on windows
Change-Id: I1882f1a49cca84456e9f94e608308d2c571fed67 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -32,13 +32,15 @@
|
|||||||
|
|
||||||
#include "localgdbprocess.h"
|
#include "localgdbprocess.h"
|
||||||
|
|
||||||
|
#include "procinterrupt.h"
|
||||||
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <utils/winutils.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
|
||||||
#include <errno.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <string.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user