Commit 66e01e88 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger[TCF-Trk]: Send RemoveExecutables command.

parent c9e9d701
......@@ -1128,19 +1128,27 @@ void TcfTrkGdbAdapter::write(const QByteArray &data)
m_gdbProc.write(data);
}
void TcfTrkGdbAdapter::cleanup()
{
delete m_gdbServer;
m_gdbServer = 0;
if (!m_trkIODevice.isNull()) {
if (QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(m_trkIODevice.data())) {
if (socket->state() == QAbstractSocket::ConnectedState)
QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(m_trkIODevice.data());
const bool isOpen = socket ? socket->state() == QAbstractSocket::ConnectedState : m_trkIODevice->isOpen();
if (isOpen) { // Not sure if that is required: Remove Trk's context?
if (!m_remoteExecutable.isEmpty() && m_uid) {
m_trkDevice->sendSettingsRemoveExecutableCommand(m_remoteExecutable, m_uid);
m_uid = 0;
}
}
if (isOpen) {
if (socket) {
socket->disconnect();
} else {
m_trkIODevice->close();
} else {
m_trkIODevice->close();
}
}
}
} //!m_trkIODevice.isNull()
}
void TcfTrkGdbAdapter::shutdown()
......
......@@ -36,6 +36,7 @@
#include <QtCore/QQueue>
#include <QtCore/QTextStream>
#include <QtCore/QDateTime>
#include <QtCore/QFileInfo>
enum { debug = 0 };
......@@ -688,6 +689,23 @@ void TcfTrkDevice::sendProcessTerminateCommand(const TcfTrkCallback &callBack,
sendTcfTrkMessage(MessageWithReply, ProcessesService, "terminate", data, callBack, cookie);
}
// Non-standard: Remove executable from settings
void TcfTrkDevice::sendSettingsRemoveExecutableCommand(const QString &binaryIn,
unsigned uid,
const QStringList &additionalLibraries,
const QVariant &cookie)
{
QByteArray setData;
JsonInputStream setStr(setData);
setStr << "" << '\0'
<< '[' << "removedExecutables" << ',' << "removedLibraries" << ']'
<< '\0' << '['
<< '{' << QFileInfo(binaryIn).fileName() << ':' << QString::number(uid, 16) << '}' << ','
<< additionalLibraries
<< ']';
sendTcfTrkMessage(MessageWithoutReply, SettingsService, "set", setData, TcfTrkCallback(), cookie);
}
void TcfTrkDevice::sendRunControlResumeCommand(const TcfTrkCallback &callBack,
const QByteArray &id,
RunControlResumeMode mode,
......
......@@ -162,6 +162,13 @@ public:
const QByteArray &id,
const QVariant &cookie = QVariant());
// Non-standard: Remove executable from settings.
// Probably needs to be called after stopping. This command has no response.
void sendSettingsRemoveExecutableCommand(const QString &binaryIn,
unsigned uid,
const QStringList &additionalLibraries = QStringList(),
const QVariant &cookie = QVariant());
void sendRunControlSuspendCommand(const TcfTrkCallback &callBack,
const QByteArray &id,
const QVariant &cookie = QVariant());
......
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