Skip to content
Snippets Groups Projects
Commit cbb3aee0 authored by Denis Shienkov's avatar Denis Shienkov Committed by Tim Sander
Browse files

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: default avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTim Sander <tim@krieglstein.org>
parent ac8626aa
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,11 @@ GdbServerProviderProcess::GdbServerProviderProcess(
const QSharedPointer<const ProjectExplorer::IDevice> &device,
QObject *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)),
SIGNAL(error(QProcess::ProcessError)));
connect(m_process, SIGNAL(finished(int)), SIGNAL(finished()));
......@@ -62,7 +65,10 @@ GdbServerProviderProcess::GdbServerProviderProcess(
void GdbServerProviderProcess::start(const QString &executable, const QStringList &arguments)
{
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()
......
......@@ -33,6 +33,8 @@
#include <projectexplorer/devicesupport/deviceprocess.h>
namespace Utils { class QtcProcess; }
namespace BareMetal {
namespace Internal {
......@@ -64,7 +66,7 @@ public:
qint64 write(const QByteArray &data);
private:
QProcess * const m_process;
Utils::QtcProcess *m_process;
};
} // namespace Internal
......
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