Commit 8d319ce8 authored by Tobias Nätterlund's avatar Tobias Nätterlund Committed by hjk

QNX: Add support for attaching to a running application

This adds a new menu item to the Debug -> Start Debugging menu,
which shows a processes dialog for the user, listing the processes
on the selected device. Clicking Attach to Application launches
pdebug on the device and then starts the gdb engine to attach
to the selected process.

This adds a DeviceTypeKitChooser class to ProjectExplorer, to
only have the KitChooser show kits configured for a specific
device type.

Change-Id: I1572dc76a6bdc4774dbf2e8cc96ca6bcf0f79a0a
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7ed15760
/****************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "devicetypekitchooser.h"
#include "kitinformation.h"
using namespace ProjectExplorer;
DeviceTypeKitChooser::DeviceTypeKitChooser(Core::Id deviceType, QWidget *parent)
: KitChooser(parent)
, m_deviceType(deviceType)
{
}
bool DeviceTypeKitChooser::kitMatches(const Kit *k) const
{
if (!KitChooser::kitMatches(k))
return false;
return DeviceTypeKitInformation::deviceTypeId(k) == m_deviceType;
}
/****************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef PROJECTEXPLORER_DEVICETYPEKITCHOOSER_H
#define PROJECTEXPLORER_DEVICETYPEKITCHOOSER_H
#include "../kitchooser.h"
#include "../projectexplorer_export.h"
#include <coreplugin/id.h>
namespace ProjectExplorer {
class PROJECTEXPLORER_EXPORT DeviceTypeKitChooser : public KitChooser
{
Q_OBJECT
public:
explicit DeviceTypeKitChooser(Core::Id deviceType, QWidget *parent = 0);
protected:
bool kitMatches(const Kit *k) const;
private:
Core::Id m_deviceType;
};
} // namespace ProjectExplorer
#endif // PROJECTEXPLORER_DEVICETYPEKITCHOOSER_H
...@@ -128,6 +128,7 @@ HEADERS += projectexplorer.h \ ...@@ -128,6 +128,7 @@ HEADERS += projectexplorer.h \
devicesupport/devicesettingswidget.h \ devicesupport/devicesettingswidget.h \
devicesupport/devicesettingspage.h \ devicesupport/devicesettingspage.h \
devicesupport/devicetestdialog.h \ devicesupport/devicetestdialog.h \
devicesupport/devicetypekitchooser.h \
devicesupport/deviceusedportsgatherer.h \ devicesupport/deviceusedportsgatherer.h \
devicesupport/deviceapplicationrunner.h \ devicesupport/deviceapplicationrunner.h \
devicesupport/localprocesslist.h \ devicesupport/localprocesslist.h \
...@@ -258,6 +259,7 @@ SOURCES += projectexplorer.cpp \ ...@@ -258,6 +259,7 @@ SOURCES += projectexplorer.cpp \
devicesupport/devicesettingswidget.cpp \ devicesupport/devicesettingswidget.cpp \
devicesupport/devicesettingspage.cpp \ devicesupport/devicesettingspage.cpp \
devicesupport/devicetestdialog.cpp \ devicesupport/devicetestdialog.cpp \
devicesupport/devicetypekitchooser.cpp \
devicesupport/deviceusedportsgatherer.cpp \ devicesupport/deviceusedportsgatherer.cpp \
devicesupport/deviceapplicationrunner.cpp \ devicesupport/deviceapplicationrunner.cpp \
devicesupport/localprocesslist.cpp \ devicesupport/localprocesslist.cpp \
......
...@@ -185,6 +185,7 @@ QtcPlugin { ...@@ -185,6 +185,7 @@ QtcPlugin {
"devicesettingspage.cpp", "devicesettingspage.h", "devicesettingspage.cpp", "devicesettingspage.h",
"devicesettingswidget.cpp", "devicesettingswidget.h", "devicesettingswidget.ui", "devicesettingswidget.cpp", "devicesettingswidget.h", "devicesettingswidget.ui",
"devicetestdialog.cpp", "devicetestdialog.h", "devicetestdialog.ui", "devicetestdialog.cpp", "devicetestdialog.h", "devicetestdialog.ui",
"devicetypekitchooser.cpp", "devicetypekitchooser.h",
"deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h", "deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h",
"idevice.cpp", "idevice.h", "idevice.cpp", "idevice.h",
"idevicefactory.cpp", "idevicefactory.h", "idevicefactory.cpp", "idevicefactory.h",
......
...@@ -99,7 +99,9 @@ SOURCES += qnxplugin.cpp \ ...@@ -99,7 +99,9 @@ SOURCES += qnxplugin.cpp \
blackberrydebugtokenpinsdialog.cpp \ blackberrydebugtokenpinsdialog.cpp \
blackberrycheckdevicestatusstepfactory.cpp \ blackberrycheckdevicestatusstepfactory.cpp \
blackberrycheckdevicestatusstepconfigwidget.cpp \ blackberrycheckdevicestatusstepconfigwidget.cpp \
blackberrycheckdevicestatusstep.cpp blackberrycheckdevicestatusstep.cpp \
qnxattachdebugsupport.cpp \
qnxattachdebugdialog.cpp
HEADERS += qnxplugin.h\ HEADERS += qnxplugin.h\
qnxconstants.h \ qnxconstants.h \
...@@ -198,8 +200,9 @@ HEADERS += qnxplugin.h\ ...@@ -198,8 +200,9 @@ HEADERS += qnxplugin.h\
blackberrydebugtokenpinsdialog.h \ blackberrydebugtokenpinsdialog.h \
blackberrycheckdevicestatusstep.h \ blackberrycheckdevicestatusstep.h \
blackberrycheckdevicestatusstepfactory.h \ blackberrycheckdevicestatusstepfactory.h \
blackberrycheckdevicestatusstepconfigwidget.h blackberrycheckdevicestatusstepconfigwidget.h \
qnxattachdebugsupport.h \
qnxattachdebugdialog.h
FORMS += \ FORMS += \
blackberrydeviceconfigurationwizardsetuppage.ui \ blackberrydeviceconfigurationwizardsetuppage.ui \
......
...@@ -200,6 +200,10 @@ QtcPlugin { ...@@ -200,6 +200,10 @@ QtcPlugin {
"qnx.qrc", "qnx.qrc",
"qnxabstractqtversion.cpp", "qnxabstractqtversion.cpp",
"qnxabstractqtversion.h", "qnxabstractqtversion.h",
"qnxattachdebugsupport.cpp",
"qnxattachdebugsupport.h",
"qnxattachdebugdialog.cpp",
"qnxattachdebugdialog.h",
"qnxbaseqtconfigwidget.cpp", "qnxbaseqtconfigwidget.cpp",
"qnxbaseqtconfigwidget.h", "qnxbaseqtconfigwidget.h",
"qnxbaseqtconfigwidget.ui", "qnxbaseqtconfigwidget.ui",
......
/**************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "qnxattachdebugdialog.h"
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <QFormLayout>
#include <QLabel>
#include <QVBoxLayout>
using namespace Qnx;
using namespace Qnx::Internal;
QnxAttachDebugDialog::QnxAttachDebugDialog(ProjectExplorer::KitChooser *kitChooser, QWidget *parent)
: ProjectExplorer::DeviceProcessesDialog(kitChooser, parent)
{
QVBoxLayout *mainLayout = dynamic_cast<QVBoxLayout*>(layout());
QTC_ASSERT(mainLayout, return);
QFormLayout *formLayout = new QFormLayout;
QLabel *sourceLabel = new QLabel(tr("Project source directory:"), this);
m_projectSource = new Utils::PathChooser(this);
m_projectSource->setExpectedKind(Utils::PathChooser::ExistingDirectory);
formLayout->addRow(sourceLabel, m_projectSource);
QLabel *binaryLabel = new QLabel(tr("Local executable:"), this);
m_localExecutable = new Utils::PathChooser(this);
m_localExecutable->setExpectedKind(Utils::PathChooser::File);
formLayout->addRow(binaryLabel, m_localExecutable);
mainLayout->insertLayout(mainLayout->count() - 2, formLayout);
}
QString QnxAttachDebugDialog::projectSource() const
{
return m_projectSource->path();
}
QString QnxAttachDebugDialog::localExecutable() const
{
return m_localExecutable->path();
}
/**************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H
#define QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
namespace Utils {
class PathChooser;
}
namespace Qnx {
namespace Internal {
class QnxAttachDebugDialog : public ProjectExplorer::DeviceProcessesDialog
{
Q_OBJECT
public:
explicit QnxAttachDebugDialog(ProjectExplorer::KitChooser *kitChooser, QWidget *parent = 0);
QString projectSource() const;
QString localExecutable() const;
private:
Utils::PathChooser *m_projectSource;
Utils::PathChooser *m_localExecutable;
};
} // namespace Internal
} // namespace Qnx
#endif // QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H
/**************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "qnxattachdebugsupport.h"
#include "qnxattachdebugdialog.h"
#include "qnxconstants.h"
#include "qnxqtversion.h"
#include "qnxutils.h"
#include <debugger/debuggerengine.h>
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/devicesupport/devicetypekitchooser.h>
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
#include <projectexplorer/devicesupport/deviceprocesslist.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/portlist.h>
#include <utils/qtcassert.h>
using namespace Qnx;
using namespace Qnx::Internal;
QnxAttachDebugSupport::QnxAttachDebugSupport(QObject *parent)
: QObject(parent)
, m_kit(0)
, m_engine(0)
, m_pdebugPort(-1)
{
m_runner = new ProjectExplorer::DeviceApplicationRunner(this);
m_portsGatherer = new ProjectExplorer::DeviceUsedPortsGatherer(this);
connect(m_portsGatherer, SIGNAL(portListReady()), this, SLOT(launchPDebug()));
connect(m_portsGatherer, SIGNAL(error(QString)), this, SLOT(handleError(QString)));
connect(m_runner, SIGNAL(remoteProcessStarted()), this, SLOT(attachToProcess()));
connect(m_runner, SIGNAL(reportError(QString)), this, SLOT(handleError(QString)));
connect(m_runner, SIGNAL(reportProgress(QString)), this, SLOT(handleProgressReport(QString)));
connect(m_runner, SIGNAL(remoteStdout(QByteArray)), this, SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteStderr(QByteArray)), this, SLOT(handleRemoteOutput(QByteArray)));
}
void QnxAttachDebugSupport::showProcessesDialog()
{
ProjectExplorer::DeviceTypeKitChooser *kitChooser = new ProjectExplorer::DeviceTypeKitChooser(Core::Id(Constants::QNX_QNX_OS_TYPE));
QnxAttachDebugDialog dlg(kitChooser, 0);
dlg.addAcceptButton(ProjectExplorer::DeviceProcessesDialog::tr("&Attach to Process"));
dlg.showAllDevices();
if (dlg.exec() == QDialog::Rejected)
return;
m_kit = kitChooser->currentKit();
if (!m_kit)
return;
m_device = ProjectExplorer::DeviceKitInformation::device(m_kit);
QTC_ASSERT(m_device, return);
m_process = dlg.currentProcess();
m_projectSourceDirectory = dlg.projectSource();
m_localExecutablePath = dlg.localExecutable();
m_portsGatherer->start(m_device);
}
void QnxAttachDebugSupport::launchPDebug()
{
Utils::PortList portList = m_device->freePorts();
m_pdebugPort = m_portsGatherer->getNextFreePort(&portList);
if (m_pdebugPort == -1) {
handleError(tr("No free ports for debugging."));
return;
}
const QString remoteCommand = QLatin1String("pdebug");
QStringList arguments;
arguments << QString::number(m_pdebugPort);
m_runner->start(m_device, remoteCommand, arguments);
}
void QnxAttachDebugSupport::attachToProcess()
{
Debugger::DebuggerStartParameters sp;
sp.attachPID = m_process.pid;
sp.startMode = Debugger::AttachToRemoteServer;
sp.closeMode = Debugger::DetachAtClose;
sp.masterEngineType = Debugger::GdbEngineType;
sp.connParams.port = m_pdebugPort;
sp.remoteChannel = m_device->sshParameters().host + QLatin1Char(':') + QString::number(m_pdebugPort);
sp.displayName = tr("Remote: \"%1:%2\" - Process %3").arg(sp.connParams.host).arg(m_pdebugPort).arg(m_process.pid);
sp.debuggerCommand = Debugger::DebuggerKitInformation::debuggerCommand(m_kit).toString();
sp.projectSourceDirectory = m_projectSourceDirectory;
sp.executable = m_localExecutablePath;
if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_kit))
sp.toolChainAbi = tc->targetAbi();
sp.useCtrlCStub = true;
QnxQtVersion *qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(m_kit));
if (qtVersion)
sp.solibSearchPath = QnxUtils::searchPaths(qtVersion);
QString errorMessage;
Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerPlugin::createDebugger(sp, 0, &errorMessage);
if (!errorMessage.isEmpty()) {
handleError(errorMessage);
stopPDebug();
return;
}
m_engine = runControl->engine();
connect(m_engine, SIGNAL(stateChanged(Debugger::DebuggerState)), this, SLOT(handleDebuggerStateChanged(Debugger::DebuggerState)));
ProjectExplorer::ProjectExplorerPlugin::instance()->startRunControl(runControl, ProjectExplorer::DebugRunMode);
}
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
{
if (state == Debugger::DebuggerFinished)
stopPDebug();
}
void QnxAttachDebugSupport::handleError(const QString &message)
{
if (m_engine)
m_engine->showMessage(message, Debugger::AppError);
}
void QnxAttachDebugSupport::handleProgressReport(const QString &message)
{
if (m_engine)
m_engine->showMessage(message + QLatin1Char('\n'), Debugger::AppStuff);
}
void QnxAttachDebugSupport::handleRemoteOutput(const QByteArray &output)
{
if (m_engine)
m_engine->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
}
void QnxAttachDebugSupport::stopPDebug()
{
m_runner->stop();
}
/**************************************************************************
**
** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company
** Contact: info@kdab.com
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H
#define QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H
#include <debugger/debuggerconstants.h>
#include <projectexplorer/devicesupport/deviceprocesslist.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <QObject>
namespace Debugger {
class DebuggerEngine;
}
namespace ProjectExplorer {
class DeviceApplicationRunner;
class DeviceUsedPortsGatherer;
class Kit;
}
namespace Qnx {
namespace Internal {
class QnxAttachDebugSupport : public QObject
{
Q_OBJECT
public:
explicit QnxAttachDebugSupport(QObject *parent = 0);
public slots:
void showProcessesDialog();
private slots:
void launchPDebug();
void attachToProcess();
void handleDebuggerStateChanged(Debugger::DebuggerState state);
void handleError(const QString &message);
void handleProgressReport(const QString &message);
void handleRemoteOutput(const QByteArray &output);
private:
void stopPDebug();
ProjectExplorer::Kit *m_kit;
ProjectExplorer::IDevice::ConstPtr m_device;
ProjectExplorer::DeviceProcessItem m_process;
ProjectExplorer::DeviceApplicationRunner *m_runner;
ProjectExplorer::DeviceUsedPortsGatherer *m_portsGatherer;
Debugger::DebuggerEngine *m_engine;
int m_pdebugPort;
QString m_projectSourceDirectory;
QString m_localExecutablePath;
};
} // namespace Internal
} // namespace Qnx
#endif // QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H
...@@ -115,6 +115,8 @@ const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1"; ...@@ -115,6 +115,8 @@ const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1";
const char QNX_BLACKBERRY_CONFIGS_FILENAME[] = "bbndkconfigurations.xml"; const char QNX_BLACKBERRY_CONFIGS_FILENAME[] = "bbndkconfigurations.xml";
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
} // namespace Constants } // namespace Constants
} // namespace Qnx } // namespace Qnx
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "blackberrydeploystepfactory.h" #include "blackberrydeploystepfactory.h"
#include "blackberryrunconfigurationfactory.h" #include "blackberryrunconfigurationfactory.h"
#include "blackberryruncontrolfactory.h" #include "blackberryruncontrolfactory.h"
#include "qnxattachdebugsupport.h"
#include "qnxdeviceconfigurationfactory.h" #include "qnxdeviceconfigurationfactory.h"
#include "qnxruncontrolfactory.h" #include "qnxruncontrolfactory.h"
#include "qnxdeploystepfactory.h" #include "qnxdeploystepfactory.h"
...@@ -55,19 +56,27 @@ ...@@ -55,19 +56,27 @@
#include "blackberryconfiguration.h" #include "blackberryconfiguration.h"
#include "cascadesimport/cascadesimportwizard.h" #include "cascadesimport/cascadesimportwizard.h"
#include "qnxtoolchain.h" #include "qnxtoolchain.h"
#include "qnxattachdebugsupport.h"
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h> #include <coreplugin/mimedatabase.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <projectexplorer/kitmanager.h> #include <projectexplorer/kitmanager.h>
#include <QAction>
#include <QtPlugin> #include <QtPlugin>
using namespace Qnx::Internal; using namespace Qnx::Internal;
QNXPlugin::QNXPlugin() QNXPlugin::QNXPlugin()
: m_debugSeparator(0)
, m_attachToQnxApplication(0)
{ {
} }
...@@ -130,6 +139,23 @@ void QNXPlugin::extensionsInitialized() ...@@ -130,6 +139,23 @@ void QNXPlugin::extensionsInitialized()
{ {
ProjectExplorer::TaskHub::addCategory(Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR, ProjectExplorer::TaskHub::addCategory(Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR,
tr("Bar Descriptor")); tr("Bar Descriptor"));
// Debug support
QnxAttachDebugSupport *debugSupport = new QnxAttachDebugSupport(this);
m_attachToQnxApplication = new QAction(this);
m_attachToQnxApplication->setText(tr("Attach to Remote QNX Application..."));
connect(m_attachToQnxApplication, SIGNAL(triggered()), debugSupport, SLOT(showProcessesDialog()));
const Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::ActionContainer *mstart = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
mstart->appendGroup(Constants::QNX_DEBUGGING_GROUP);
mstart->addSeparator(globalcontext, Constants::QNX_DEBUGGING_GROUP, &m_debugSeparator);
Core::Command *cmd = Core::ActionManager::registerAction(m_attachToQnxApplication, "Debugger.AttachToQnxApplication", globalcontext);
mstart->addAction(