forked from qt-creator/qt-creator
Add api to get some debugger state about engines
That’s needed for GammaRay integration. Change-Id: I67a5dba81fa8d88024395126c45d0a3e9cfdd457 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -149,6 +149,8 @@
|
|||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -2152,6 +2154,29 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
|
|||||||
createAndScheduleRun(rp, kit);
|
createAndScheduleRun(rp, kit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerPlugin::getEnginesState(QByteArray *json) const
|
||||||
|
{
|
||||||
|
QTC_ASSERT(json, return);
|
||||||
|
QVariantMap result {
|
||||||
|
{ "version", 1 }
|
||||||
|
};
|
||||||
|
QVariantMap states;
|
||||||
|
|
||||||
|
for (int i = 0; i < dd->m_snapshotHandler->size(); ++i) {
|
||||||
|
const DebuggerEngine *engine = dd->m_snapshotHandler->at(i);
|
||||||
|
states[QString::number(i)] = QVariantMap({
|
||||||
|
{ "current", dd->m_snapshotHandler->currentIndex() == i },
|
||||||
|
{ "pid", engine->inferiorPid() },
|
||||||
|
{ "state", engine->state() }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!states.isEmpty())
|
||||||
|
result["states"] = states;
|
||||||
|
|
||||||
|
*json = QJsonDocument(QJsonObject::fromVariantMap(result)).toJson();
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerPluginPrivate::attachToQmlPort()
|
void DebuggerPluginPrivate::attachToQmlPort()
|
||||||
{
|
{
|
||||||
DebuggerRunParameters rp;
|
DebuggerRunParameters rp;
|
||||||
|
@@ -56,6 +56,9 @@ private:
|
|||||||
// Called from AppOutputPane::attachToRunControl().
|
// Called from AppOutputPane::attachToRunControl().
|
||||||
Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc);
|
Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc);
|
||||||
|
|
||||||
|
// Called from GammaRayIntegration
|
||||||
|
Q_SLOT void getEnginesState(QByteArray *json) const;
|
||||||
|
|
||||||
QList<QObject *> createTestObjects() const override;
|
QList<QObject *> createTestObjects() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user