From b9ca111ab131b8b6db4a1169c436cebdf1f503cd Mon Sep 17 00:00:00 2001 From: Marcus Folkesson Date: Mon, 5 Nov 2012 15:16:12 +0100 Subject: debugger: gdb: Use RemoteGdbServerAdapter for StartRemoteProcess mode The RemoteGdbServerAdapter should be invoked (instead of LocalPlainGdbAdapter) when using startmode StartRemoteProcess. Change-Id: I0f4c9dc2a275ef4b42ddf5b425b8dee839c83458 Signed-off-by: Marcus Folkesson Reviewed-by: Orgad Shaneh Reviewed-by: hjk (cherry picked from commit 0b121abb5e6d47aeef55f049ffc95e0e072f2707) --- src/plugins/debugger/gdb/gdbengine.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/debugger') diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 02078f40f1..9b63495d16 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -5367,6 +5367,7 @@ DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp) switch (sp.startMode) { case AttachCore: return new GdbCoreEngine(sp); + case StartRemoteProcess: case AttachToRemoteServer: return new GdbRemoteServerEngine(sp); case StartRemoteGdb: -- cgit v1.2.1 From 7b000a05695ffb88d3b67df4faba171d986fd870 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 19 Nov 2012 10:05:43 +0100 Subject: debugger: fix win64interrupt start when installed into path with spaces Change-Id: I88796cf54fb4308b1f6e200a9233d8fb42bd9f01 Reviewed-by: Friedemann Kleint --- src/plugins/debugger/procinterrupt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/debugger') diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index 54a250437c..49c003972b 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -134,7 +134,7 @@ bool Debugger::Internal::interruptProcess(int pID, int engineType, QString *erro *errorMessage = QLatin1String("DebugBreakProcess failed: ") + Utils::winErrorMessage(GetLastError()); } else { const QString executable = QCoreApplication::applicationDirPath() + QLatin1String("/win64interrupt.exe"); - switch (QProcess::execute(executable + QLatin1Char(' ') + QString::number(pID))) { + switch (QProcess::execute(executable, QStringList(QString::number(pID)))) { case -2: *errorMessage = QString::fromLatin1("Cannot start %1. Check src\\tools\\win64interrupt\\win64interrupt.c for more information."). arg(QDir::toNativeSeparators(executable)); -- cgit v1.2.1 From 4930fbcc1e0693e2bc891f047150a06fb687eaf4 Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Wed, 21 Nov 2012 17:46:58 +0100 Subject: QML Debugging: Qt 5 CONFIG+=declarative_debug qml_debug Pass both arguments to qmake. The assumption being that most projects will not mix both Qt Quick 1 and Qt Quick 2. In the case of others, debugging will be enabled only for the first debugging client that is enabled. This is inline with the current behaviour where debugging multiple engines is not supported. Change-Id: I90cd6c6ff559a3a7519ee3ee10690c0e8135c97b Reviewed-by: hjk Reviewed-by: Kai Koehne --- src/plugins/debugger/qml/qmlinspectoradapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/debugger') diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.cpp b/src/plugins/debugger/qml/qmlinspectoradapter.cpp index e48c3392b3..164d77258c 100644 --- a/src/plugins/debugger/qml/qmlinspectoradapter.cpp +++ b/src/plugins/debugger/qml/qmlinspectoradapter.cpp @@ -251,7 +251,8 @@ void QmlInspectorAdapter::engineClientStatusChanged(QmlDebug::ClientStatus statu BaseEngineDebugClient *client = qobject_cast(sender()); - if (status == QmlDebug::Enabled) { + if (status == QmlDebug::Enabled && !m_engineClientConnected) { + // We accept the first client that is enabled and reject the others. QTC_ASSERT(client, return); setActiveEngineClient(client); } else if (m_engineClientConnected && client == m_engineClient) { -- cgit v1.2.1 From 32a0afb9df4971aa433428340b30d773cae464f7 Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Fri, 23 Nov 2012 17:15:29 +0100 Subject: Inspector: Fetch objects lazily QML objects are fetched lazily when constructing the object tree. Incase parents have not been previously fetched, we fetch the required data to construct only the relevant branch of the tree. Task-number: QTCREATORBUG-8246 Change-Id: Id529c3b2334d33ff4eb46b14f50cf042ad2960e2 Reviewed-by: hjk --- src/plugins/debugger/qml/qmlinspectoragent.cpp | 67 +++++++++++++++++++++----- src/plugins/debugger/qml/qmlinspectoragent.h | 2 +- src/plugins/debugger/watchhandler.cpp | 5 ++ src/plugins/debugger/watchhandler.h | 1 + 4 files changed, 61 insertions(+), 14 deletions(-) (limited to 'src/plugins/debugger') diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index a1098b9fd6..1573a9cdb0 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -62,6 +62,7 @@ QmlInspectorAgent::QmlInspectorAgent(DebuggerEngine *engine, QObject *parent) , m_objectToSelect(-1) , m_newObjectsCreated(false) { + m_debugIdToIname.insert(-1, QByteArray("inspect")); connect(debuggerCore()->action(ShowQmlObjectTree), SIGNAL(valueChanged(QVariant)), SLOT(updateStatus())); m_delayQueryTimer.setSingleShot(true); @@ -452,17 +453,17 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value, } if (m_objectTreeQueryIds.contains(queryId)) { + m_objectTreeQueryIds.removeOne(queryId); if (value.type() == QVariant::List) { QVariantList objList = value.toList(); foreach (QVariant var, objList) { // TODO: check which among the list is the actual // object that needs to be selected. - insertObjectInTree(qvariant_cast(var)); + verifyAndInsertObjectInTree(qvariant_cast(var)); } } else { - insertObjectInTree(qvariant_cast(value)); + verifyAndInsertObjectInTree(qvariant_cast(value)); } - m_objectTreeQueryIds.removeOne(queryId); } else if (queryId == m_engineQueryId) { m_engineQueryId = 0; QList engines = qvariant_cast >(value); @@ -608,13 +609,13 @@ void QmlInspectorAgent::updateObjectTree(const ContextReference &context) return; foreach (const ObjectReference & obj, context.objects()) - insertObjectInTree(obj); + verifyAndInsertObjectInTree(obj); foreach (const ContextReference &child, context.contexts()) updateObjectTree(child); } -void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object) +void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &object) { if (debug) qDebug() << __FUNCTION__ << '(' << object << ')'; @@ -622,17 +623,56 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object) if (!object.isValid()) return; - QElapsedTimer timeElapsed; - // sync tree with watchhandler - QList watchData; - int objectDebugId = object.debugId(); + // Find out the correct position in the tree + // Objects are inserted to the tree if they satisfy one of the two conditions. + // Condition 1: Object is a root object i.e. parentId == -1. + // Condition 2: Object has an expanded parent i.e. siblings are known. + // If the two conditions are not met then we push the object to a stack and recursively + // fetch parents till we find a previously expanded parent. + + WatchHandler *handler = m_debuggerEngine->watchHandler(); + const int parentId = object.parentId(); + const int objectDebugId = object.debugId(); + if (m_debugIdToIname.contains(parentId)) { + QByteArray parentIname = m_debugIdToIname.value(parentId); + if (parentId != -1 && !handler->isExpandedIName(parentIname)) { + m_objectStack.push(object); + handler->model()->fetchMore(handler->watchDataIndex(parentIname)); + return; // recursive + } + insertObjectInTree(object); - // When root items are inserted in the object tree, m_objectTreeQueryIds = 0 - if (!m_debugIdToIname.contains(objectDebugId) && m_objectTreeQueryIds.count()) - return; + } else { + m_objectStack.push(object); + fetchObject(parentId); + return; // recursive + } + if (!m_objectStack.isEmpty()) { + const ObjectReference &top = m_objectStack.top(); + // We want to expand only a particular branch and not the whole tree. Hence, we do not + // expand siblings. + if (object.children().contains(top)) { + QByteArray objectIname = m_debugIdToIname.value(objectDebugId); + if (!handler->isExpandedIName(objectIname)) { + handler->model()->fetchMore(handler->watchDataIndex(objectIname)); + } else { + verifyAndInsertObjectInTree(m_objectStack.pop()); + return; // recursive + } + } + } +} + +void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object) +{ + if (debug) + qDebug() << __FUNCTION__ << '(' << object << ')'; - int parentId = parentIdForIname(m_debugIdToIname.value(objectDebugId)); + const int objectDebugId = object.debugId(); + const int parentId = parentIdForIname(m_debugIdToIname.value(objectDebugId)); + QElapsedTimer timeElapsed; + QList watchData; if (debug) timeElapsed.start(); watchData.append(buildWatchData(object, m_debugIdToIname.value(parentId), true)); @@ -829,6 +869,7 @@ void QmlInspectorAgent::clearObjectTree() m_debugIdHash.clear(); m_debugIdHash.reserve(old_count + 1); m_debugIdToIname.clear(); + m_debugIdToIname.insert(-1, QByteArray("inspect")); m_objectStack.clear(); // reset only for qt > 4.8.3. if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE)) diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index d83f79b5b3..7f60e5cd8f 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -110,7 +110,7 @@ private slots: private: void updateObjectTree(const QmlDebug::ContextReference &context); - + void verifyAndInsertObjectInTree(const QmlDebug::ObjectReference &object); void insertObjectInTree(const QmlDebug::ObjectReference &result); void buildDebugIdHashRecursive(const QmlDebug::ObjectReference &ref); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 8b1d3a6583..58fa111b31 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1807,6 +1807,11 @@ const WatchData *WatchHandler::watchData(const QModelIndex &idx) const return m_model->watchItem(idx); } +const QModelIndex WatchHandler::watchDataIndex(const QByteArray &iname) const +{ + return m_model->watchIndex(m_model->findItem(iname)); +} + const WatchData *WatchHandler::findData(const QByteArray &iname) const { return m_model->findItem(iname); diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index b5d8622c9e..a7c1c6d3b6 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -85,6 +85,7 @@ public: void showEditValue(const WatchData &data); const WatchData *watchData(const QModelIndex &) const; + const QModelIndex watchDataIndex(const QByteArray &iname) const; const WatchData *findData(const QByteArray &iname) const; const WatchData *findCppLocalVariable(const QString &name) const; QString displayForAutoTest(const QByteArray &iname) const; -- cgit v1.2.1