Commit cbb3aee0 authored by Denis Shienkov's avatar Denis Shienkov Committed by Tim Sander

BareMetal: Kill the GDB server provider when debugging stopped

On Windows when debugging is stopped, the QProcess::terminate()
method does nothing. At least it belongs to the started OpenOCD
process. It is better to use Utils::QtcProcess with setup of a
setUseCtrlCStub(true) instead of QProcess.

Change-Id: I954377dc94de77fbae630e096a252530f12aaf2d
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTim Sander <tim@krieglstein.org>
parent ac8626aa
...@@ -45,8 +45,11 @@ GdbServerProviderProcess::GdbServerProviderProcess( ...@@ -45,8 +45,11 @@ GdbServerProviderProcess::GdbServerProviderProcess(
const QSharedPointer<const ProjectExplorer::IDevice> &device, const QSharedPointer<const ProjectExplorer::IDevice> &device,
QObject *parent) QObject *parent)
: ProjectExplorer::DeviceProcess(device, parent) : ProjectExplorer::DeviceProcess(device, parent)
, m_process(new QProcess(this)) , m_process(new Utils::QtcProcess(this))
{ {
if (Utils::HostOsInfo::isWindowsHost())
m_process->setUseCtrlCStub(true);
connect(m_process, SIGNAL(error(QProcess::ProcessError)), connect(m_process, SIGNAL(error(QProcess::ProcessError)),
SIGNAL(error(QProcess::ProcessError))); SIGNAL(error(QProcess::ProcessError)));
connect(m_process, SIGNAL(finished(int)), SIGNAL(finished())); connect(m_process, SIGNAL(finished(int)), SIGNAL(finished()));
...@@ -62,7 +65,10 @@ GdbServerProviderProcess::GdbServerProviderProcess( ...@@ -62,7 +65,10 @@ GdbServerProviderProcess::GdbServerProviderProcess(
void GdbServerProviderProcess::start(const QString &executable, const QStringList &arguments) void GdbServerProviderProcess::start(const QString &executable, const QStringList &arguments)
{ {
QTC_ASSERT(m_process->state() == QProcess::NotRunning, return); QTC_ASSERT(m_process->state() == QProcess::NotRunning, return);
m_process->start(executable, arguments); QString args;
Utils::QtcProcess::addArgs(&args, arguments);
m_process->setCommand(executable, args);
m_process->start();
} }
void GdbServerProviderProcess::interrupt() void GdbServerProviderProcess::interrupt()
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <projectexplorer/devicesupport/deviceprocess.h> #include <projectexplorer/devicesupport/deviceprocess.h>
namespace Utils { class QtcProcess; }
namespace BareMetal { namespace BareMetal {
namespace Internal { namespace Internal {
...@@ -64,7 +66,7 @@ public: ...@@ -64,7 +66,7 @@ public:
qint64 write(const QByteArray &data); qint64 write(const QByteArray &data);
private: private:
QProcess * const m_process; Utils::QtcProcess *m_process;
}; };
} // namespace Internal } // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment