diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-03-23 17:50:29 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-03-23 17:50:29 +0100 |
commit | 51988bb5e03f1d8a5d35974f2eef862f59a44421 (patch) | |
tree | 37b69fd7ab2ee684afda4401b9c89a6c5c4b1ca3 /src/plugins | |
parent | 6badd0aa0512d4379b2136a77035a8e1e5522537 (diff) | |
parent | cd4ce50a3b78e2f349ef83640802727c6858e0fc (diff) | |
download | qt-creator-51988bb5e03f1d8a5d35974f2eef862f59a44421.tar.gz |
Merge remote-tracking branch 'origin/2.5'
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 26 | ||||
-rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.cpp | 25 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/formeditor/formeditorview.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxplugin.cpp | 33 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxplugin.h | 1 | ||||
-rw-r--r-- | src/plugins/remotelinux/startgdbserverdialog.cpp | 44 |
6 files changed, 80 insertions, 51 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 19aa868c87..0eb329b346 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1115,6 +1115,7 @@ public slots: void maybeEnrichParameters(DebuggerStartParameters *sp); void gdbServerStarted(const QString &channel, const QString &sysroot, const QString &localExecutable); + void attachedToProcess(const QString &channel, const QString &sysroot, const QString &localExecutable); public: DebuggerMainWindow *m_mainWindow; @@ -1672,11 +1673,6 @@ void DebuggerPluginPrivate::attachToRemoteServer() } } -void DebuggerPluginPrivate::attachToRemoteProcess() -{ - startRemoteServer(); -} - void DebuggerPluginPrivate::startRemoteServer() { PluginManager *pm = PluginManager::instance(); @@ -1690,6 +1686,24 @@ void DebuggerPluginPrivate::startRemoteServer() void DebuggerPluginPrivate::gdbServerStarted(const QString &channel, const QString &sysroot, const QString &remoteCommandLine) { + Q_UNUSED(remoteCommandLine); + Q_UNUSED(sysroot); + showStatusMessage(tr("gdbserver is now listening at %1").arg(channel)); +} + +void DebuggerPluginPrivate::attachToRemoteProcess() +{ + PluginManager *pm = PluginManager::instance(); + QTC_ASSERT(pm, return); + QObject *rl = pm->getObjectByName(_("RemoteLinuxPlugin")); + QTC_ASSERT(rl, return); + QMetaObject::invokeMethod(rl, "attachToRemoteProcess", Qt::QueuedConnection); + // This will call back attachedtToProcess() below. +} + +void DebuggerPluginPrivate::attachedToProcess(const QString &channel, + const QString &sysroot, const QString &remoteCommandLine) +{ QString binary = remoteCommandLine.section(QLatin1Char(' '), 0, 0); QString localExecutable; QString candidate = sysroot + QLatin1Char('/') + binary; @@ -3075,7 +3089,7 @@ void DebuggerPluginPrivate::extensionsInitialized() connect(act, SIGNAL(triggered()), SLOT(attachToRemoteServer())); act = m_startRemoteServerAction = new QAction(this); - act->setText(tr("Start Remote Debug Server...")); + act->setText(tr("Start Remote Debug Server Attached to Process...")); connect(act, SIGNAL(triggered()), SLOT(startRemoteServer())); act = m_attachToRemoteProcessAction = new QAction(this); diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index a73f04eb95..74e0f1ffae 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -45,6 +45,7 @@ #include <utils/qtcassert.h> #include <QDir> +#include <QFileInfo> #include <QProcess> #include <QSettings> #include <QUrl> @@ -646,6 +647,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect() return results; } +// Detect CDB, return a pair of <32bit, 64bit> executables. QPair<Utils::FileName, Utils::FileName> MsvcToolChain::autoDetectCdbDebugger() { QPair<Utils::FileName, Utils::FileName> result; @@ -660,6 +662,29 @@ QPair<Utils::FileName, Utils::FileName> MsvcToolChain::autoDetectCdbDebugger() if (dirName.isEmpty()) continue; QDir dir(dirName); + // Windows SDK's starting from version 8 live in + // "ProgramDir\Windows Kits\<version>" + const QString windowsKitsFolderName = QLatin1String("Windows Kits"); + if (dir.exists(windowsKitsFolderName)) { + QDir windowKitsFolder = dir; + if (windowKitsFolder.cd(windowsKitsFolderName)) { + // Check in reverse order (latest first) + const QFileInfoList kitFolders = + windowKitsFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, + QDir::Time|QDir::Reversed); + foreach (const QFileInfo &kitFolderFi, kitFolders) { + const QString path = kitFolderFi.absoluteFilePath(); + const QFileInfo cdb32(path + QLatin1String("/Debuggers/x86/cdb.exe")); + if (cdb32.isExecutable()) + cdbs.push_back(Utils::FileName::fromString(cdb32.absoluteFilePath())); + const QFileInfo cdb64(path + QLatin1String("/Debuggers/x64/cdb.exe")); + if (cdb64.isExecutable()) + cdbs.push_back(Utils::FileName::fromString(cdb64.absoluteFilePath())); + } // for Kits + } // can cd to "Windows Kits" + } // "Windows Kits" exists + + // Pre Windows SDK 8: Check 'Debugging Tools for Windows' foreach (const QFileInfo &fi, dir.entryInfoList(QStringList(QLatin1String("Debugging Tools for Windows*")), QDir::Dirs | QDir::NoDotAndDotDot)) { Utils::FileName filePath(fi); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 21bb70db66..88ae5c677e 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -286,7 +286,7 @@ void FormEditorView::nodeIdChanged(const ModelNode& node, const QString& newId, QmlModelView::nodeIdChanged(node, newId, oldId); QmlItemNode itemNode(node); - if (itemNode.isValid()) { + if (itemNode.isValid() && node.nodeSourceType() == ModelNode::NodeWithoutSource) { FormEditorItem *item = m_scene->itemForQmlItemNode(itemNode); item->update(); } diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 6a21e597b3..0cf91f4fdf 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -91,41 +91,20 @@ RemoteLinuxPlugin::~RemoteLinuxPlugin() void RemoteLinuxPlugin::extensionsInitialized() { - /* - using namespace Core; - ICore *core = ICore::instance(); - ActionManager *am = core->actionManager(); - ActionContainer *mstart = - am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING); - - const Context globalcontext(Core::Constants::C_GLOBAL); - - QAction *act = 0; - Command *cmd = 0; - - act = new QAction(tr("Start Remote Debug Server..."), 0); - cmd = am->registerAction(act, "StartGdbServer", globalcontext); - cmd->setDescription(tr("Start Gdbserver")); - mstart->addAction(cmd, Debugger::Constants::G_MANUAL_REMOTE); - connect(act, SIGNAL(triggered()), SLOT(startGdbServer())); - - act = new QAction(tr("Attach to Running Remote Process..."), 0); - cmd = am->registerAction(act, "AttachRemoteProcess", globalcontext); - cmd->setDescription(tr("Attach to Remote Process")); - mstart->addAction(cmd, Debugger::Constants::G_AUTOMATIC_REMOTE); - connect(act, SIGNAL(triggered()), SLOT(startGdbServer())); - */ } void RemoteLinuxPlugin::startGdbServer() { StartGdbServerDialog dlg; - int result = dlg.exec(); - if (result == QDialog::Rejected) - return; dlg.startGdbServer(); } +void RemoteLinuxPlugin::attachToRemoteProcess() +{ + StartGdbServerDialog dlg; + dlg.attachToRemoteProcess(); +} + } // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxplugin.h b/src/plugins/remotelinux/remotelinuxplugin.h index f8cc714074..7307bc8ea4 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.h +++ b/src/plugins/remotelinux/remotelinuxplugin.h @@ -52,6 +52,7 @@ public: private slots: void startGdbServer(); + void attachToRemoteProcess(); }; } // namespace Internal diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp index cd2ab8ace2..384d2c2d74 100644 --- a/src/plugins/remotelinux/startgdbserverdialog.cpp +++ b/src/plugins/remotelinux/startgdbserverdialog.cpp @@ -93,6 +93,7 @@ public: } StartGdbServerDialog *q; + bool startServerOnly; AbstractRemoteLinuxProcessList *processList; QSortFilterProxyModel proxyModel; @@ -111,7 +112,7 @@ public: }; StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q) - : q(q), processList(0) + : q(q), startServerOnly(true), processList(0) { settings = ICore::settings(); @@ -321,13 +322,20 @@ void StartGdbServerDialog::portListReady() void StartGdbServerDialog::startGdbServer() { + d->startServerOnly = true; + if (exec() == QDialog::Rejected) + return; LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); d->gatherer.start(SshConnection::create(device->sshParameters()), device); } void StartGdbServerDialog::attachToRemoteProcess() { - startGdbServer(); + d->startServerOnly = false; + if (exec() == QDialog::Rejected) + return; + LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); + d->gatherer.start(SshConnection::create(device->sshParameters()), device); } void StartGdbServerDialog::handleConnectionError() @@ -351,29 +359,31 @@ void StartGdbServerDialog::handleProcessErrorOutput(const QByteArray &ba) logMessage(QString::fromUtf8(ba.trimmed())); // "Attached; pid = 16740" // "Listening on port 10000" - int pos = ba.indexOf("Listening on port"); - if (pos == -1) - return; - const int port = ba.mid(pos + 18).trimmed().toInt(); - logMessage(tr("Port %1 is now accessible.").arg(port)); - reportOpenPort(port); + foreach (const QByteArray &line, ba.split('\n')) { + if (line.startsWith("Listening on port")) { + const int port = line.mid(18).trimmed().toInt(); + reportOpenPort(port); + } + } } void StartGdbServerDialog::reportOpenPort(int port) { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - QObject *ob = pm->getObjectByName("DebuggerCore"); - if (!ob) - return; - + logMessage(tr("Port %1 is now accessible.").arg(port)); LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); QString channel = QString("%1:%2").arg(device->sshParameters().host).arg(port); logMessage(tr("Server started on %1").arg(channel)); - QMetaObject::invokeMethod(ob, "gdbServerStarted", Qt::QueuedConnection, - Q_ARG(QString, channel), - Q_ARG(QString, d->sysrootPathChooser->path()), - Q_ARG(QString, d->remoteCommandLine)); + const char *member = d->startServerOnly ? "gdbServerStarted" : "attachedToProcess"; + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + QObject *ob = pm->getObjectByName("DebuggerCore"); + if (ob) { + QMetaObject::invokeMethod(ob, member, Qt::QueuedConnection, + Q_ARG(QString, channel), + Q_ARG(QString, d->sysrootPathChooser->path()), + Q_ARG(QString, d->remoteCommandLine)); + } + close(); } void StartGdbServerDialog::handleProcessClosed(int status) |