forked from qt-creator/qt-creator
debugger: adjust to profile changes
This replaces the debugger command, sysroot and target abi fields with a profile id. Change-Id: I831c42ff8624fcfa520c2f28f6f06d73191b2680 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -37,9 +37,10 @@
|
|||||||
#include "androidrunner.h"
|
#include "androidrunner.h"
|
||||||
#include "androidmanager.h"
|
#include "androidmanager.h"
|
||||||
|
|
||||||
#include <debugger/debuggerplugin.h>
|
|
||||||
#include <debugger/debuggerrunner.h>
|
|
||||||
#include <debugger/debuggerengine.h>
|
#include <debugger/debuggerengine.h>
|
||||||
|
#include <debugger/debuggerplugin.h>
|
||||||
|
#include <debugger/debuggerprofileinformation.h>
|
||||||
|
#include <debugger/debuggerrunner.h>
|
||||||
#include <debugger/debuggerstartparameters.h>
|
#include <debugger/debuggerstartparameters.h>
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -69,11 +70,14 @@ static Qt4Project *project(AndroidRunConfiguration *rc)
|
|||||||
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig)
|
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig)
|
||||||
{
|
{
|
||||||
DebuggerStartParameters params;
|
DebuggerStartParameters params;
|
||||||
params.toolChainAbi = runConfig->abi();
|
Profile *profile = runConfig->target()->profile();
|
||||||
|
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
|
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||||
|
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
|
||||||
|
params.toolChainAbi = tc->targetAbi();
|
||||||
params.dumperLibrary = runConfig->dumperLib();
|
params.dumperLibrary = runConfig->dumperLib();
|
||||||
params.startMode = AttachToRemoteServer;
|
params.startMode = AttachToRemoteServer;
|
||||||
params.executable = project(runConfig)->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
|
params.executable = project(runConfig)->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
|
||||||
params.debuggerCommand = runConfig->gdbCmd().toString();
|
|
||||||
params.remoteChannel = runConfig->remoteChannel();
|
params.remoteChannel = runConfig->remoteChannel();
|
||||||
params.displayName = AndroidManager::packageName(runConfig->target());
|
params.displayName = AndroidManager::packageName(runConfig->target());
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="toolchainLabel">
|
<widget class="QLabel" name="toolchainLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Tool chain:</string>
|
<string>&Target:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>toolchainComboBox</cstring>
|
<cstring>toolchainComboBox</cstring>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolchainComboBox"/>
|
<widget class="Debugger::ProfileChooser" name="toolchainComboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="Utils::PathChooser" name="overrideStartScriptFileName" native="true"/>
|
<widget class="Utils::PathChooser" name="overrideStartScriptFileName" native="true"/>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
</slots>
|
</slots>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Debugger::Internal::DebuggerToolChainComboBox</class>
|
<class>Debugger::ProfileChooser</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>debuggertoolchaincombobox.h</header>
|
<header>debuggertoolchaincombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="toolchainLabel">
|
<widget class="QLabel" name="toolchainLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Tool chain:</string>
|
<string>&Target:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>toolchainComboBox</cstring>
|
<cstring>toolchainComboBox</cstring>
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolchainComboBox"/>
|
<widget class="Debugger::ProfileChooser" name="toolchainComboBox"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<header location="global">utils/filterlineedit.h</header>
|
<header location="global">utils/filterlineedit.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Debugger::Internal::DebuggerToolChainComboBox</class>
|
<class>Debugger::ProfileChooser</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>debuggertoolchaincombobox.h</header>
|
<header>debuggertoolchaincombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
@@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Debugger::Internal::AttachToQmlPortDialog</class>
|
|
||||||
<widget class="QDialog" name="Debugger::Internal::AttachToQmlPortDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>212</width>
|
|
||||||
<height>136</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Start Debugger</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="hostLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Host:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>hostLineEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="hostLineEdit">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">localhost</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="portLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Port:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>portSpinBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="portSpinBox">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>3768</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="sysrootLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Sys&root:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>sysRootChooser</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="sysRootChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::PathChooser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">utils/pathchooser.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
<slots>
|
|
||||||
<signal>editingFinished()</signal>
|
|
||||||
<signal>browsingFinished()</signal>
|
|
||||||
</slots>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@@ -368,24 +368,13 @@ static inline bool isMsvcFlavor(Abi::OSFlavor osf)
|
|||||||
|| osf == Abi::WindowsMsvc2010Flavor;
|
|| osf == Abi::WindowsMsvc2010Flavor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString cdbBinary(const DebuggerStartParameters &sp)
|
|
||||||
{
|
|
||||||
if (!sp.debuggerCommand.isEmpty()) {
|
|
||||||
// Do not use a GDB binary if we got started for a project with MinGW runtime.
|
|
||||||
const bool abiMatch = sp.toolChainAbi.os() == Abi::WindowsOS
|
|
||||||
&& isMsvcFlavor(sp.toolChainAbi.osFlavor());
|
|
||||||
if (abiMatch)
|
|
||||||
return sp.debuggerCommand;
|
|
||||||
}
|
|
||||||
return debuggerCore()->debuggerForAbi(sp.toolChainAbi, CdbEngineType);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
|
bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
const Abi abi = toolChainAbi(sp);
|
||||||
if (!isCdbEngineEnabled()) {
|
if (!isCdbEngineEnabled()) {
|
||||||
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
|
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
|
||||||
arg(sp.toolChainAbi.toString()));
|
arg(abi.toString()));
|
||||||
check->settingsCategory = QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
|
check->settingsCategory = QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
|
||||||
check->settingsPage = CdbOptionsPage::settingsId();
|
check->settingsPage = CdbOptionsPage::settingsId();
|
||||||
return false;
|
return false;
|
||||||
@@ -396,19 +385,19 @@ bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp.toolChainAbi.binaryFormat() != Abi::PEFormat || sp.toolChainAbi.os() != Abi::WindowsOS) {
|
if (abi.binaryFormat() != Abi::PEFormat || abi.os() != Abi::WindowsOS) {
|
||||||
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
|
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
|
||||||
arg(sp.toolChainAbi.toString()));
|
arg(abi.toString()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp.startMode == AttachCore && !isMsvcFlavor(sp.toolChainAbi.osFlavor())) {
|
if (sp.startMode == AttachCore && !isMsvcFlavor(abi.osFlavor())) {
|
||||||
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug gdb core files."));
|
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug gdb core files."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cdbBinary(sp).isEmpty()) {
|
if (debuggerCommand(sp).isEmpty()) {
|
||||||
check->errorDetails.push_back(msgNoCdbBinaryForToolChain(sp.toolChainAbi));
|
check->errorDetails.push_back(msgNoCdbBinaryForToolChain(abi));
|
||||||
check->settingsCategory = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
check->settingsCategory = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
||||||
check->settingsPage = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
check->settingsPage = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
||||||
return false;
|
return false;
|
||||||
@@ -722,7 +711,7 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
|
|||||||
// Determine binary (force MSVC), extension lib name and path to use
|
// Determine binary (force MSVC), extension lib name and path to use
|
||||||
// The extension is passed as relative name with the path variable set
|
// The extension is passed as relative name with the path variable set
|
||||||
//(does not work with absolute path names)
|
//(does not work with absolute path names)
|
||||||
const QString executable = cdbBinary(sp);
|
const QString executable = sp.debuggerCommand;
|
||||||
if (executable.isEmpty()) {
|
if (executable.isEmpty()) {
|
||||||
*errorMessage = tr("There is no CDB executable specified.");
|
*errorMessage = tr("There is no CDB executable specified.");
|
||||||
return false;
|
return false;
|
||||||
|
@@ -143,8 +143,7 @@ FORMS += attachexternaldialog.ui \
|
|||||||
commonoptionspage.ui \
|
commonoptionspage.ui \
|
||||||
startexternaldialog.ui \
|
startexternaldialog.ui \
|
||||||
startremotedialog.ui \
|
startremotedialog.ui \
|
||||||
startremoteenginedialog.ui \
|
startremoteenginedialog.ui
|
||||||
attachtoqmlportdialog.ui
|
|
||||||
|
|
||||||
RESOURCES += debugger.qrc
|
RESOURCES += debugger.qrc
|
||||||
|
|
||||||
|
@@ -42,7 +42,6 @@ QtcPlugin {
|
|||||||
"debuggerprofileinformation.h",
|
"debuggerprofileinformation.h",
|
||||||
"attachcoredialog.ui",
|
"attachcoredialog.ui",
|
||||||
"attachexternaldialog.ui",
|
"attachexternaldialog.ui",
|
||||||
"attachtoqmlportdialog.ui",
|
|
||||||
"basewindow.cpp",
|
"basewindow.cpp",
|
||||||
"breakhandler.cpp",
|
"breakhandler.cpp",
|
||||||
"breakhandler.h",
|
"breakhandler.h",
|
||||||
|
@@ -110,8 +110,8 @@ public:
|
|||||||
virtual bool initialize(const QStringList &arguments, QString *errorMessage) = 0;
|
virtual bool initialize(const QStringList &arguments, QString *errorMessage) = 0;
|
||||||
virtual QWidget *mainWindow() const = 0;
|
virtual QWidget *mainWindow() const = 0;
|
||||||
virtual bool isDockVisible(const QString &objectName) const = 0;
|
virtual bool isDockVisible(const QString &objectName) const = 0;
|
||||||
virtual QString debuggerForAbi(const ProjectExplorer::Abi &abi,
|
// virtual QString debuggerForAbi(const ProjectExplorer::Abi &abi,
|
||||||
DebuggerEngineType et = NoEngineType) const = 0;
|
// DebuggerEngineType et = NoEngineType) const = 0;
|
||||||
virtual void showModuleSymbols(const QString &moduleName,
|
virtual void showModuleSymbols(const QString &moduleName,
|
||||||
const QVector<Symbol> &symbols) = 0;
|
const QVector<Symbol> &symbols) = 0;
|
||||||
virtual void openMemoryEditor() = 0;
|
virtual void openMemoryEditor() = 0;
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerprofileinformation.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
|
#include "debuggertoolchaincombobox.h"
|
||||||
#include "cdb/cdbengine.h"
|
#include "cdb/cdbengine.h"
|
||||||
#include "shared/hostutils.h"
|
#include "shared/hostutils.h"
|
||||||
|
|
||||||
@@ -44,31 +45,40 @@
|
|||||||
#include "ui_startexternaldialog.h"
|
#include "ui_startexternaldialog.h"
|
||||||
#include "ui_startremotedialog.h"
|
#include "ui_startremotedialog.h"
|
||||||
#include "ui_startremoteenginedialog.h"
|
#include "ui_startremoteenginedialog.h"
|
||||||
#include "ui_attachtoqmlportdialog.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/profileinformation.h>
|
||||||
#include <utils/historycompleter.h>
|
#include <utils/historycompleter.h>
|
||||||
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QButtonGroup>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QRegExp>
|
|
||||||
|
|
||||||
#include <QButtonGroup>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QGridLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
|
#include <QRegExp>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QGridLayout>
|
#include <QVariant>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -232,9 +242,9 @@ void AttachCoreDialog::setCoreFile(const QString &fileName)
|
|||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *AttachCoreDialog::profile() const
|
Core::Id AttachCoreDialog::profileId() const
|
||||||
{
|
{
|
||||||
return m_ui->toolchainComboBox->currentProfile();
|
return m_ui->toolchainComboBox->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachCoreDialog::setProfileIndex(int i)
|
void AttachCoreDialog::setProfileIndex(int i)
|
||||||
@@ -379,9 +389,9 @@ QString AttachExternalDialog::executable() const
|
|||||||
return m_model->executableForPid(attachPIDText());
|
return m_model->executableForPid(attachPIDText());
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *AttachExternalDialog::profile() const
|
Core::Id AttachExternalDialog::profileId() const
|
||||||
{
|
{
|
||||||
return m_ui->toolchainComboBox->currentProfile();
|
return m_ui->toolchainComboBox->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachExternalDialog::setProfileIndex(int i)
|
void AttachExternalDialog::setProfileIndex(int i)
|
||||||
@@ -587,9 +597,9 @@ QString StartExternalDialog::executableFile() const
|
|||||||
return m_ui->execFile->path();
|
return m_ui->execFile->path();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *StartExternalDialog::profile() const
|
Core::Id StartExternalDialog::profileId() const
|
||||||
{
|
{
|
||||||
return m_ui->toolChainComboBox->currentProfile();
|
return m_ui->toolChainComboBox->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartExternalDialog::isValid() const
|
bool StartExternalDialog::isValid() const
|
||||||
@@ -670,28 +680,14 @@ bool StartExternalDialog::run(QWidget *parent,
|
|||||||
writeParameterHistory(history, settings, settingsGroup, arrayName);
|
writeParameterHistory(history, settings, settingsGroup, arrayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *profile = dialog.profile();
|
fillParameters(sp, dialog.profileId());
|
||||||
QTC_ASSERT(profile, return false);
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
|
||||||
QTC_ASSERT(tc, return false);
|
|
||||||
|
|
||||||
sp->executable = newParameters.executableFile;
|
sp->executable = newParameters.executableFile;
|
||||||
sp->startMode = StartExternal;
|
sp->startMode = StartExternal;
|
||||||
sp->toolChainAbi = tc->targetAbi();
|
|
||||||
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
|
||||||
sp->workingDirectory = newParameters.workingDirectory;
|
sp->workingDirectory = newParameters.workingDirectory;
|
||||||
sp->displayName = sp->executable;
|
sp->displayName = sp->executable;
|
||||||
sp->useTerminal = newParameters.runInTerminal;
|
sp->useTerminal = newParameters.runInTerminal;
|
||||||
if (!newParameters.arguments.isEmpty())
|
if (!newParameters.arguments.isEmpty())
|
||||||
sp->processArgs = newParameters.arguments;
|
sp->processArgs = newParameters.arguments;
|
||||||
// Fixme: 1 of 3 testing hacks.
|
|
||||||
if (sp->processArgs.startsWith(QLatin1String("@tcf@ ")) || sp->processArgs.startsWith(QLatin1String("@sym@ ")))
|
|
||||||
// Set up an ARM Symbian Abi
|
|
||||||
sp->toolChainAbi = Abi(Abi::ArmArchitecture,
|
|
||||||
Abi::SymbianOS,
|
|
||||||
Abi::SymbianDeviceFlavor,
|
|
||||||
Abi::ElfFormat, false);
|
|
||||||
|
|
||||||
sp->breakOnMain = newParameters.breakAtMain;
|
sp->breakOnMain = newParameters.breakAtMain;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -847,17 +843,11 @@ bool StartRemoteDialog::run(QWidget *parent,
|
|||||||
writeParameterHistory(history, settings, settingsGroup, arrayName);
|
writeParameterHistory(history, settings, settingsGroup, arrayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *profile = dialog.profile();
|
fillParameters(sp, dialog.profileId());
|
||||||
QTC_ASSERT(profile, return false);
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
|
||||||
QTC_ASSERT(tc, return false);
|
|
||||||
|
|
||||||
sp->remoteChannel = newParameters.remoteChannel;
|
sp->remoteChannel = newParameters.remoteChannel;
|
||||||
sp->remoteArchitecture = newParameters.remoteArchitecture;
|
sp->remoteArchitecture = newParameters.remoteArchitecture;
|
||||||
sp->executable = newParameters.localExecutable;
|
sp->executable = newParameters.localExecutable;
|
||||||
sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel);
|
sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel);
|
||||||
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
|
||||||
sp->toolChainAbi = tc->targetAbi();
|
|
||||||
sp->overrideStartScript = newParameters.overrideStartScript;
|
sp->overrideStartScript = newParameters.overrideStartScript;
|
||||||
sp->useServerStartScript = newParameters.useServerStartScript;
|
sp->useServerStartScript = newParameters.useServerStartScript;
|
||||||
sp->serverStartScript = newParameters.serverStartScript;
|
sp->serverStartScript = newParameters.serverStartScript;
|
||||||
@@ -911,9 +901,9 @@ void StartRemoteDialog::historyIndexChanged(int index)
|
|||||||
setParameters(v.value<StartRemoteParameters>());
|
setParameters(v.value<StartRemoteParameters>());
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *StartRemoteDialog::profile() const
|
Core::Id StartRemoteDialog::profileId() const
|
||||||
{
|
{
|
||||||
return m_ui->toolchainComboBox->currentProfile();
|
return m_ui->toolchainComboBox->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartRemoteDialog::setRemoteArchitectures(const QStringList &list)
|
void StartRemoteDialog::setRemoteArchitectures(const QStringList &list)
|
||||||
@@ -938,51 +928,97 @@ void StartRemoteDialog::updateState()
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class AttachToQmlPortDialogPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QLabel *hostLabel;
|
||||||
|
QLineEdit *hostLineEdit;
|
||||||
|
QLabel *portLabel;
|
||||||
|
QSpinBox *portSpinBox;
|
||||||
|
QLabel *profileLabel;
|
||||||
|
Debugger::ProfileChooser *profileChooser;
|
||||||
|
};
|
||||||
|
|
||||||
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
||||||
: QDialog(parent),
|
: QDialog(parent),
|
||||||
m_ui(new Ui::AttachToQmlPortDialog)
|
d(new AttachToQmlPortDialogPrivate)
|
||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
m_ui->setupUi(this);
|
setWindowTitle(tr("Start Debugger"));
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
|
||||||
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
d->hostLineEdit = new QLineEdit(this);
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
d->hostLineEdit->setText(QString::fromUtf8("localhost"));
|
||||||
|
|
||||||
|
d->hostLabel = new QLabel(this);
|
||||||
|
d->hostLabel->setText(tr("&Host:"));
|
||||||
|
d->hostLabel->setBuddy(d->hostLineEdit);
|
||||||
|
|
||||||
|
d->portSpinBox = new QSpinBox(this);
|
||||||
|
d->portSpinBox->setMaximum(65535);
|
||||||
|
d->portSpinBox->setValue(3768);
|
||||||
|
|
||||||
|
d->portLabel = new QLabel(this);
|
||||||
|
d->portLabel->setText(tr("&Port:"));
|
||||||
|
d->portLabel->setBuddy(d->portSpinBox);
|
||||||
|
|
||||||
|
d->profileChooser = new Debugger::ProfileChooser(this);
|
||||||
|
|
||||||
|
d->profileLabel = new QLabel(this);
|
||||||
|
d->profileLabel->setText(tr("Target:"));
|
||||||
|
|
||||||
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
|
||||||
|
buttonBox->setOrientation(Qt::Horizontal);
|
||||||
|
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||||
|
|
||||||
|
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
||||||
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
|
|
||||||
|
formLayout->addRow(d->hostLabel, d->hostLineEdit);
|
||||||
|
formLayout->addRow(d->portLabel, d->portSpinBox);
|
||||||
|
formLayout->addRow(d->profileLabel, d->profileChooser);
|
||||||
|
|
||||||
|
verticalLayout->addLayout(formLayout);
|
||||||
|
verticalLayout->addWidget(buttonBox);
|
||||||
|
|
||||||
|
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||||
|
|
||||||
|
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AttachToQmlPortDialog::~AttachToQmlPortDialog()
|
AttachToQmlPortDialog::~AttachToQmlPortDialog()
|
||||||
{
|
{
|
||||||
delete m_ui;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachToQmlPortDialog::setHost(const QString &host)
|
void AttachToQmlPortDialog::setHost(const QString &host)
|
||||||
{
|
{
|
||||||
m_ui->hostLineEdit->setText(host);
|
d->hostLineEdit->setText(host);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AttachToQmlPortDialog::host() const
|
QString AttachToQmlPortDialog::host() const
|
||||||
{
|
{
|
||||||
return m_ui->hostLineEdit->text();
|
return d->hostLineEdit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachToQmlPortDialog::setPort(const int port)
|
void AttachToQmlPortDialog::setPort(const int port)
|
||||||
{
|
{
|
||||||
m_ui->portSpinBox->setValue(port);
|
d->portSpinBox->setValue(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
int AttachToQmlPortDialog::port() const
|
int AttachToQmlPortDialog::port() const
|
||||||
{
|
{
|
||||||
return m_ui->portSpinBox->value();
|
return d->portSpinBox->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AttachToQmlPortDialog::sysroot() const
|
Core::Id AttachToQmlPortDialog::profileId() const
|
||||||
{
|
{
|
||||||
return m_ui->sysRootChooser->path();
|
return d->profileChooser->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachToQmlPortDialog::setSysroot(const QString &sysroot)
|
void AttachToQmlPortDialog::setProfileId(const Core::Id &id)
|
||||||
{
|
{
|
||||||
m_ui->sysRootChooser->setPath(sysroot);
|
d->profileChooser->setCurrentProfileId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------- StartRemoteCdbDialog
|
// --------- StartRemoteCdbDialog
|
||||||
|
@@ -45,6 +45,7 @@ class QDialogButtonBox;
|
|||||||
class QSettings;
|
class QSettings;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Core { class Id; }
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Profile; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
@@ -57,13 +58,13 @@ class AttachCoreDialog;
|
|||||||
class AttachExternalDialog;
|
class AttachExternalDialog;
|
||||||
class StartExternalDialog;
|
class StartExternalDialog;
|
||||||
class StartRemoteDialog;
|
class StartRemoteDialog;
|
||||||
class AttachToQmlPortDialog;
|
|
||||||
class StartRemoteEngineDialog;
|
class StartRemoteEngineDialog;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
class ProcessListFilterModel;
|
class ProcessListFilterModel;
|
||||||
class StartExternalParameters;
|
class StartExternalParameters;
|
||||||
class StartRemoteParameters;
|
class StartRemoteParameters;
|
||||||
|
class AttachToQmlPortDialogPrivate;
|
||||||
|
|
||||||
class AttachCoreDialog : public QDialog
|
class AttachCoreDialog : public QDialog
|
||||||
{
|
{
|
||||||
@@ -81,7 +82,7 @@ public:
|
|||||||
|
|
||||||
int profileIndex() const;
|
int profileIndex() const;
|
||||||
void setProfileIndex(int);
|
void setProfileIndex(int);
|
||||||
ProjectExplorer::Profile *profile() const;
|
Core::Id profileId() const;
|
||||||
|
|
||||||
QString overrideStartScript() const;
|
QString overrideStartScript() const;
|
||||||
void setOverrideStartScript(const QString &scriptName);
|
void setOverrideStartScript(const QString &scriptName);
|
||||||
@@ -108,7 +109,7 @@ public:
|
|||||||
|
|
||||||
int profileIndex() const;
|
int profileIndex() const;
|
||||||
void setProfileIndex(int);
|
void setProfileIndex(int);
|
||||||
ProjectExplorer::Profile *profile() const;
|
Core::Id profileId() const;
|
||||||
|
|
||||||
void accept();
|
void accept();
|
||||||
|
|
||||||
@@ -150,7 +151,7 @@ private:
|
|||||||
QString executableFile() const;
|
QString executableFile() const;
|
||||||
void setExecutableFile(const QString &executable);
|
void setExecutableFile(const QString &executable);
|
||||||
|
|
||||||
ProjectExplorer::Profile *profile() const;
|
Core::Id profileId() const;
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
Ui::StartExternalDialog *m_ui;
|
Ui::StartExternalDialog *m_ui;
|
||||||
@@ -178,7 +179,7 @@ private:
|
|||||||
|
|
||||||
void setRemoteArchitectures(const QStringList &list);
|
void setRemoteArchitectures(const QStringList &list);
|
||||||
|
|
||||||
ProjectExplorer::Profile *profile() const;
|
Core::Id profileId() const;
|
||||||
|
|
||||||
Ui::StartRemoteDialog *m_ui;
|
Ui::StartRemoteDialog *m_ui;
|
||||||
};
|
};
|
||||||
@@ -197,11 +198,11 @@ public:
|
|||||||
int port() const;
|
int port() const;
|
||||||
void setPort(const int port);
|
void setPort(const int port);
|
||||||
|
|
||||||
QString sysroot() const;
|
Core::Id profileId() const;
|
||||||
void setSysroot(const QString &sysroot);
|
void setProfileId(const Core::Id &id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AttachToQmlPortDialog *m_ui;
|
AttachToQmlPortDialogPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StartRemoteCdbDialog : public QDialog
|
class StartRemoteCdbDialog : public QDialog
|
||||||
|
@@ -185,8 +185,6 @@ public:
|
|||||||
m_taskHub(0)
|
m_taskHub(0)
|
||||||
{
|
{
|
||||||
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
|
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
|
||||||
if (sp.toolChainAbi.os() == Abi::MacOS)
|
|
||||||
m_disassemblerAgent.setTryMixed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~DebuggerEnginePrivate() {}
|
~DebuggerEnginePrivate() {}
|
||||||
@@ -1321,9 +1319,10 @@ DebuggerLanguages DebuggerEngine::languages() const
|
|||||||
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
|
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
|
||||||
{
|
{
|
||||||
// make sure file finder is properly initialized
|
// make sure file finder is properly initialized
|
||||||
d->m_fileFinder.setProjectDirectory(startParameters().projectSourceDirectory);
|
const DebuggerStartParameters &sp = startParameters();
|
||||||
d->m_fileFinder.setProjectFiles(startParameters().projectSourceFiles);
|
d->m_fileFinder.setProjectDirectory(sp.projectSourceDirectory);
|
||||||
d->m_fileFinder.setSysroot(startParameters().sysroot);
|
d->m_fileFinder.setProjectFiles(sp.projectSourceFiles);
|
||||||
|
d->m_fileFinder.setSysroot(sp.sysRoot);
|
||||||
|
|
||||||
return d->m_fileFinder.findFile(fileUrl);
|
return d->m_fileFinder.findFile(fileUrl);
|
||||||
}
|
}
|
||||||
|
@@ -466,14 +466,6 @@ static QToolButton *toolButton(const char *id)
|
|||||||
return toolButton(Core::ActionManager::command(id)->action());
|
return toolButton(Core::ActionManager::command(id)->action());
|
||||||
}
|
}
|
||||||
|
|
||||||
static Abi anyAbiOfBinary(const QString &fileName)
|
|
||||||
{
|
|
||||||
QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(fileName));
|
|
||||||
if (abis.isEmpty())
|
|
||||||
return Abi();
|
|
||||||
return abis.at(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DummyEngine
|
// DummyEngine
|
||||||
@@ -554,6 +546,17 @@ public:
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void fillParameters(DebuggerStartParameters *sp, Core::Id id)
|
||||||
|
{
|
||||||
|
Profile *profile = ProfileManager::instance()->find(id);
|
||||||
|
QTC_ASSERT(profile, return);
|
||||||
|
sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
|
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||||
|
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||||
|
if (tc)
|
||||||
|
sp->toolChainAbi = tc->targetAbi();
|
||||||
|
}
|
||||||
|
|
||||||
static TextEditor::ITextEditor *currentTextEditor()
|
static TextEditor::ITextEditor *currentTextEditor()
|
||||||
{
|
{
|
||||||
return qobject_cast<TextEditor::ITextEditor *>(Core::EditorManager::currentEditor());
|
return qobject_cast<TextEditor::ITextEditor *>(Core::EditorManager::currentEditor());
|
||||||
@@ -768,7 +771,7 @@ public slots:
|
|||||||
void startRemoteProcess();
|
void startRemoteProcess();
|
||||||
void startRemoteServer();
|
void startRemoteServer();
|
||||||
void loadRemoteCoreFile();
|
void loadRemoteCoreFile();
|
||||||
bool queryRemoteParameters(DebuggerStartParameters &sp, bool useScript);
|
//bool queryRemoteParameters(DebuggerStartParameters &sp, bool useScript);
|
||||||
void attachToRemoteServer();
|
void attachToRemoteServer();
|
||||||
void attachToRemoteProcess();
|
void attachToRemoteProcess();
|
||||||
void attachToQmlPort();
|
void attachToQmlPort();
|
||||||
@@ -798,7 +801,7 @@ public slots:
|
|||||||
void runControlFinished(DebuggerEngine *engine);
|
void runControlFinished(DebuggerEngine *engine);
|
||||||
DebuggerLanguages activeLanguages() const;
|
DebuggerLanguages activeLanguages() const;
|
||||||
unsigned enabledEngines() const { return m_cmdLineEnabledEngines; }
|
unsigned enabledEngines() const { return m_cmdLineEnabledEngines; }
|
||||||
QString debuggerForAbi(const Abi &abi, DebuggerEngineType et = NoEngineType) const;
|
// QString debuggerForAbi(const Abi &abi, DebuggerEngineType et = NoEngineType) const;
|
||||||
void remoteCommand(const QStringList &options, const QStringList &);
|
void remoteCommand(const QStringList &options, const QStringList &);
|
||||||
|
|
||||||
bool isReverseDebugging() const;
|
bool isReverseDebugging() const;
|
||||||
@@ -1092,9 +1095,9 @@ public slots:
|
|||||||
// FIXME: Remove.
|
// FIXME: Remove.
|
||||||
void maybeEnrichParameters(DebuggerStartParameters *sp);
|
void maybeEnrichParameters(DebuggerStartParameters *sp);
|
||||||
|
|
||||||
void gdbServerStarted(const QString &channel, const QString &sysroot,
|
void gdbServerStarted(const QString &channel, const QString &profile,
|
||||||
const QString &remoteCommandLine, const QString &remoteExecutable);
|
const QString &remoteCommandLine, const QString &remoteExecutable);
|
||||||
void attachedToProcess(const QString &channel, const QString &sysroot,
|
void attachedToProcess(const QString &channel, const QString &profile,
|
||||||
const QString &remoteCommandLine, const QString &remoteExecutable);
|
const QString &remoteCommandLine, const QString &remoteExecutable);
|
||||||
|
|
||||||
void updateQmlActions() {
|
void updateQmlActions() {
|
||||||
@@ -1289,21 +1292,12 @@ void DebuggerPluginPrivate::maybeEnrichParameters(DebuggerStartParameters *sp)
|
|||||||
{
|
{
|
||||||
if (!boolSetting(AutoEnrichParameters))
|
if (!boolSetting(AutoEnrichParameters))
|
||||||
return;
|
return;
|
||||||
if (sp->sysroot.isEmpty() &&
|
const QString sysroot = sp->sysRoot;
|
||||||
(sp->startMode == AttachToRemoteServer
|
|
||||||
|| sp->startMode == StartRemoteProcess
|
|
||||||
|| sp->startMode == AttachToRemoteProcess
|
|
||||||
|| sp->startMode == LoadRemoteCore)) {
|
|
||||||
// FIXME: Get from BaseQtVersion.
|
|
||||||
sp->sysroot = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_SYSROOT"));
|
|
||||||
showMessage(QString::fromLatin1("USING QTC_DEBUGGER_SYSROOT %1")
|
|
||||||
.arg(sp->sysroot), LogWarning);
|
|
||||||
}
|
|
||||||
if (sp->debugInfoLocation.isEmpty()) {
|
if (sp->debugInfoLocation.isEmpty()) {
|
||||||
sp->debugInfoLocation = sp->sysroot + QLatin1String("/usr/lib/debug");
|
sp->debugInfoLocation = sysroot + QLatin1String("/usr/lib/debug");
|
||||||
}
|
}
|
||||||
if (sp->debugSourceLocation.isEmpty()) {
|
if (sp->debugSourceLocation.isEmpty()) {
|
||||||
QString base = sp->sysroot + QLatin1String("/usr/src/debug/");
|
QString base = sysroot + QLatin1String("/usr/src/debug/");
|
||||||
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/corelib"));
|
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/corelib"));
|
||||||
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/gui"));
|
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/gui"));
|
||||||
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/network"));
|
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/network"));
|
||||||
@@ -1318,7 +1312,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
{
|
{
|
||||||
const QString &option = *it;
|
const QString &option = *it;
|
||||||
// '-debug <pid>'
|
// '-debug <pid>'
|
||||||
// '-debug <exe>[,server=<server:port>|,core=<core>][,arch=<arch>][,sysroot=<sysroot>]'
|
// '-debug <exe>[,server=<server:port>|,core=<core>][,arch=<arch>][,profile=<profile>]'
|
||||||
if (*it == _("-debug")) {
|
if (*it == _("-debug")) {
|
||||||
++it;
|
++it;
|
||||||
if (it == cend) {
|
if (it == cend) {
|
||||||
@@ -1326,6 +1320,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
|
fillParameters(&sp, ProfileManager::instance()->defaultProfile()->id());
|
||||||
qulonglong pid = it->toULongLong();
|
qulonglong pid = it->toULongLong();
|
||||||
if (pid) {
|
if (pid) {
|
||||||
sp.startMode = AttachExternal;
|
sp.startMode = AttachExternal;
|
||||||
@@ -1333,10 +1328,9 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
sp.attachPID = pid;
|
sp.attachPID = pid;
|
||||||
sp.displayName = tr("Process %1").arg(sp.attachPID);
|
sp.displayName = tr("Process %1").arg(sp.attachPID);
|
||||||
sp.startMessage = tr("Attaching to local process %1.").arg(sp.attachPID);
|
sp.startMessage = tr("Attaching to local process %1.").arg(sp.attachPID);
|
||||||
sp.toolChainAbi = Abi::hostAbi();
|
|
||||||
} else {
|
} else {
|
||||||
QStringList args = it->split(QLatin1Char(','));
|
|
||||||
sp.startMode = StartExternal;
|
sp.startMode = StartExternal;
|
||||||
|
QStringList args = it->split(QLatin1Char(','));
|
||||||
foreach (const QString &arg, args) {
|
foreach (const QString &arg, args) {
|
||||||
QString key = arg.section(QLatin1Char('='), 0, 0);
|
QString key = arg.section(QLatin1Char('='), 0, 0);
|
||||||
QString val = arg.section(QLatin1Char('='), 1, 1);
|
QString val = arg.section(QLatin1Char('='), 1, 1);
|
||||||
@@ -1365,10 +1359,9 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
||||||
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
|
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
|
||||||
}
|
}
|
||||||
else if (key == QLatin1String("sysroot"))
|
else if (key == QLatin1String("profile"))
|
||||||
sp.sysroot = val;
|
fillParameters(&sp, Id(val));
|
||||||
}
|
}
|
||||||
sp.toolChainAbi = anyAbiOfBinary(sp.executable);
|
|
||||||
}
|
}
|
||||||
if (sp.startMode == StartExternal) {
|
if (sp.startMode == StartExternal) {
|
||||||
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
|
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
|
||||||
@@ -1389,12 +1382,12 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
|
fillParameters(&sp, ProfileManager::instance()->defaultProfile()->id());
|
||||||
sp.startMode = AttachCrashedExternal;
|
sp.startMode = AttachCrashedExternal;
|
||||||
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
|
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
|
||||||
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
|
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
|
||||||
sp.displayName = tr("Crashed process %1").arg(sp.attachPID);
|
sp.displayName = tr("Crashed process %1").arg(sp.attachPID);
|
||||||
sp.startMessage = tr("Attaching to crashed process %1").arg(sp.attachPID);
|
sp.startMessage = tr("Attaching to crashed process %1").arg(sp.attachPID);
|
||||||
sp.toolChainAbi = Abi::hostAbi();
|
|
||||||
if (!sp.attachPID) {
|
if (!sp.attachPID) {
|
||||||
*errorMessage = DebuggerPlugin::tr("The parameter '%1' of option '%2' "
|
*errorMessage = DebuggerPlugin::tr("The parameter '%1' of option '%2' "
|
||||||
"does not match the pattern <handle>:<pid>.").arg(*it, option);
|
"does not match the pattern <handle>:<pid>.").arg(*it, option);
|
||||||
@@ -1547,19 +1540,13 @@ void DebuggerPluginPrivate::attachExternalApplication()
|
|||||||
|
|
||||||
setConfigValue(_("LastAttachExternalProfileIndex"), QVariant(dlg.profileIndex()));
|
setConfigValue(_("LastAttachExternalProfileIndex"), QVariant(dlg.profileIndex()));
|
||||||
|
|
||||||
Profile *profile = dlg.profile();
|
|
||||||
QTC_ASSERT(profile, return);
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
|
||||||
QTC_ASSERT(tc, return);
|
|
||||||
|
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
|
fillParameters(&sp, dlg.profileId());
|
||||||
sp.attachPID = dlg.attachPID();
|
sp.attachPID = dlg.attachPID();
|
||||||
sp.displayName = tr("Process %1").arg(dlg.attachPID());
|
sp.displayName = tr("Process %1").arg(dlg.attachPID());
|
||||||
sp.executable = dlg.executable();
|
sp.executable = dlg.executable();
|
||||||
sp.startMode = AttachExternal;
|
sp.startMode = AttachExternal;
|
||||||
sp.closeMode = DetachAtClose;
|
sp.closeMode = DetachAtClose;
|
||||||
sp.toolChainAbi = tc->targetAbi();
|
|
||||||
sp.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
|
||||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
}
|
}
|
||||||
@@ -1567,11 +1554,11 @@ void DebuggerPluginPrivate::attachExternalApplication()
|
|||||||
void DebuggerPluginPrivate::attachExternalApplication(RunControl *rc)
|
void DebuggerPluginPrivate::attachExternalApplication(RunControl *rc)
|
||||||
{
|
{
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
|
fillParameters(&sp, ProfileManager::instance()->defaultProfile()->id()); // FIXME: Extract from rc.
|
||||||
sp.attachPID = rc->applicationProcessHandle().pid();
|
sp.attachPID = rc->applicationProcessHandle().pid();
|
||||||
sp.displayName = tr("Debugger attached to %1").arg(rc->displayName());
|
sp.displayName = tr("Debugger attached to %1").arg(rc->displayName());
|
||||||
sp.startMode = AttachExternal;
|
sp.startMode = AttachExternal;
|
||||||
sp.closeMode = DetachAtClose;
|
sp.closeMode = DetachAtClose;
|
||||||
sp.toolChainAbi = rc->abi();
|
|
||||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
}
|
}
|
||||||
@@ -1592,20 +1579,13 @@ void DebuggerPluginPrivate::attachCore()
|
|||||||
setConfigValue(_("LastExternalProfileIndex"), QVariant(dlg.profileIndex()));
|
setConfigValue(_("LastExternalProfileIndex"), QVariant(dlg.profileIndex()));
|
||||||
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
|
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
|
||||||
|
|
||||||
Profile *profile = dlg.profile();
|
|
||||||
QTC_ASSERT(profile, return);
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
|
||||||
QTC_ASSERT(tc, return);
|
|
||||||
|
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
|
fillParameters(&sp, dlg.profileId());
|
||||||
sp.executable = dlg.executableFile();
|
sp.executable = dlg.executableFile();
|
||||||
sp.coreFile = dlg.coreFile();
|
sp.coreFile = dlg.coreFile();
|
||||||
sp.displayName = tr("Core file \"%1\"").arg(dlg.coreFile());
|
sp.displayName = tr("Core file \"%1\"").arg(dlg.coreFile());
|
||||||
sp.startMode = AttachCore;
|
sp.startMode = AttachCore;
|
||||||
sp.closeMode = DetachAtClose;
|
sp.closeMode = DetachAtClose;
|
||||||
sp.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
|
||||||
sp.toolChainAbi = tc->targetAbi();
|
|
||||||
sp.sysroot = SysRootProfileInformation::sysRoot(profile).toString();
|
|
||||||
sp.overrideStartScript = dlg.overrideStartScript();
|
sp.overrideStartScript = dlg.overrideStartScript();
|
||||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
@@ -1613,26 +1593,47 @@ void DebuggerPluginPrivate::attachCore()
|
|||||||
|
|
||||||
void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec)
|
void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec)
|
||||||
{
|
{
|
||||||
// spec is: server:port@executable@architecture
|
// spec is: profile@server:port@executable@architecture
|
||||||
|
const QChar delim(QLatin1Char('@'));
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
sp.remoteChannel = spec.section(QLatin1Char('@'), 0, 0);
|
fillParameters(&sp, Id(spec.section(delim, 0, 0)));
|
||||||
sp.executable = spec.section(QLatin1Char('@'), 1, 1);
|
sp.remoteChannel = spec.section(delim, 1, 1);
|
||||||
sp.remoteArchitecture = spec.section(QLatin1Char('@'), 2, 2);
|
sp.executable = spec.section(delim, 2, 2);
|
||||||
|
sp.remoteArchitecture = spec.section(delim, 3, 3);
|
||||||
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
|
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
|
||||||
sp.startMode = AttachToRemoteServer;
|
sp.startMode = AttachToRemoteServer;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
sp.toolChainAbi = anyAbiOfBinary(sp.executable);
|
|
||||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct RemoteCdbMatcher : ProfileMatcher
|
||||||
|
{
|
||||||
|
RemoteCdbMatcher() : m_hostAbi(Abi::hostAbi()) {}
|
||||||
|
|
||||||
|
bool matches(const Profile *profile) const
|
||||||
|
{
|
||||||
|
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||||
|
QTC_ASSERT(tc, return false);
|
||||||
|
Abi abi = tc->targetAbi();
|
||||||
|
return abi.architecture() == m_hostAbi.architecture()
|
||||||
|
&& abi.os() == Abi::WindowsOS
|
||||||
|
&& abi.osFlavor() == Abi::WindowsMsvc2010Flavor
|
||||||
|
&& abi.binaryFormat() == Abi::PEFormat
|
||||||
|
&& abi.wordWidth() == m_hostAbi.wordWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
Abi m_hostAbi;
|
||||||
|
};
|
||||||
|
|
||||||
void DebuggerPluginPrivate::startRemoteCdbSession()
|
void DebuggerPluginPrivate::startRemoteCdbSession()
|
||||||
{
|
{
|
||||||
const QString connectionKey = _("CdbRemoteConnection");
|
const QString connectionKey = _("CdbRemoteConnection");
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
Abi hostAbi = Abi::hostAbi();
|
RemoteCdbMatcher matcher;
|
||||||
sp.toolChainAbi = Abi(hostAbi.architecture(), Abi::WindowsOS,
|
Profile *profile = ProfileManager::instance()->find(&matcher);
|
||||||
Abi::WindowsMsvc2010Flavor, Abi::PEFormat, hostAbi.wordWidth());
|
QTC_ASSERT(profile, return);
|
||||||
|
fillParameters(&sp, profile->id());
|
||||||
sp.startMode = AttachToRemoteServer;
|
sp.startMode = AttachToRemoteServer;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
StartRemoteCdbDialog dlg(mainWindow());
|
StartRemoteCdbDialog dlg(mainWindow());
|
||||||
@@ -1648,13 +1649,10 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
|
|||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, bool useScript)
|
//bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, bool useScript)
|
||||||
{
|
//{
|
||||||
return StartRemoteDialog::run(mainWindow(),
|
// return StartRemoteDialog::run(mainWindow(), m_coreSettings, useScript, &sp);
|
||||||
m_coreSettings,
|
//}
|
||||||
useScript,
|
|
||||||
&sp);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerPluginPrivate::startRemoteProcess()
|
void DebuggerPluginPrivate::startRemoteProcess()
|
||||||
{
|
{
|
||||||
@@ -1688,13 +1686,13 @@ void DebuggerPluginPrivate::startRemoteServer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPluginPrivate::gdbServerStarted(const QString &channel,
|
void DebuggerPluginPrivate::gdbServerStarted(const QString &channel,
|
||||||
const QString &sysroot,
|
const QString &profileId,
|
||||||
const QString &remoteCommandLine,
|
const QString &remoteCommandLine,
|
||||||
const QString &remoteExecutable)
|
const QString &remoteExecutable)
|
||||||
{
|
{
|
||||||
Q_UNUSED(remoteCommandLine);
|
Q_UNUSED(remoteCommandLine);
|
||||||
Q_UNUSED(remoteExecutable);
|
Q_UNUSED(remoteExecutable);
|
||||||
Q_UNUSED(sysroot);
|
Q_UNUSED(profileId);
|
||||||
showStatusMessage(tr("gdbserver is now listening at %1").arg(channel));
|
showStatusMessage(tr("gdbserver is now listening at %1").arg(channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1710,12 +1708,10 @@ void DebuggerPluginPrivate::loadRemoteCoreFile()
|
|||||||
dlg.setLocalCoreFileName(sp.coreFile);
|
dlg.setLocalCoreFileName(sp.coreFile);
|
||||||
if (!dlg.exec())
|
if (!dlg.exec())
|
||||||
return;
|
return;
|
||||||
|
fillParameters(&sp, dlg.profileId());
|
||||||
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
||||||
sp.startMode = AttachCore;
|
sp.startMode = AttachCore;
|
||||||
sp.closeMode = DetachAtClose;
|
sp.closeMode = DetachAtClose;
|
||||||
//sp.debuggerCommand = dlg.debuggerCommand();
|
|
||||||
//sp.toolChainAbi = dlg.abi();
|
|
||||||
sp.sysroot = dlg.sysroot();
|
|
||||||
//sp.overrideStartScript = dlg.overrideStartScript();
|
//sp.overrideStartScript = dlg.overrideStartScript();
|
||||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||||
startDebugger(rc);
|
startDebugger(rc);
|
||||||
@@ -1730,10 +1726,13 @@ void DebuggerPluginPrivate::attachToRemoteProcess()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPluginPrivate::attachedToProcess(const QString &channel,
|
void DebuggerPluginPrivate::attachedToProcess(const QString &channel,
|
||||||
const QString &sysroot,
|
const QString &profileId,
|
||||||
const QString &remoteCommandLine,
|
const QString &remoteCommandLine,
|
||||||
const QString &remoteExecutable)
|
const QString &remoteExecutable)
|
||||||
{
|
{
|
||||||
|
Profile *profile = ProfileManager::instance()->find(Id(profileId));
|
||||||
|
QTC_ASSERT(profile, return);
|
||||||
|
QString sysroot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
QString binary;
|
QString binary;
|
||||||
QString localExecutable;
|
QString localExecutable;
|
||||||
QString candidate = sysroot + remoteExecutable;
|
QString candidate = sysroot + remoteExecutable;
|
||||||
@@ -1771,11 +1770,9 @@ void DebuggerPluginPrivate::attachedToProcess(const QString &channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
sp.toolChainAbi = abis.at(0);
|
fillParameters(&sp, Id(profileId));
|
||||||
//sp.remoteArchitecture = abis.at(0).toString();
|
|
||||||
sp.displayName = tr("Remote: \"%1\"").arg(channel);
|
sp.displayName = tr("Remote: \"%1\"").arg(channel);
|
||||||
sp.remoteChannel = channel;
|
sp.remoteChannel = channel;
|
||||||
sp.sysroot = sysroot;
|
|
||||||
sp.executable = localExecutable;
|
sp.executable = localExecutable;
|
||||||
sp.startMode = AttachToRemoteServer;
|
sp.startMode = AttachToRemoteServer;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
@@ -1806,20 +1803,20 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
|||||||
dlg.setPort(sp.qmlServerPort);
|
dlg.setPort(sp.qmlServerPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVariant sysrootPath = configValue(_("LastSysroot"));
|
const QVariant profileId = configValue(_("LastProfile"));
|
||||||
if (sysrootPath.isValid())
|
if (profileId.isValid())
|
||||||
dlg.setSysroot(sysrootPath.toString());
|
dlg.setProfileId(Id(profileId.toString()));
|
||||||
|
|
||||||
if (dlg.exec() != QDialog::Accepted)
|
if (dlg.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setConfigValue(_("LastQmlServerAddress"), dlg.host());
|
setConfigValue(_("LastQmlServerAddress"), dlg.host());
|
||||||
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
||||||
setConfigValue(_("LastSysroot"), dlg.sysroot());
|
setConfigValue(_("LastProfile"), dlg.profileId().toString());
|
||||||
|
|
||||||
|
fillParameters(&sp, dlg.profileId());
|
||||||
sp.qmlServerAddress = dlg.host();
|
sp.qmlServerAddress = dlg.host();
|
||||||
sp.qmlServerPort = dlg.port();
|
sp.qmlServerPort = dlg.port();
|
||||||
sp.sysroot = dlg.sysroot();
|
|
||||||
|
|
||||||
sp.startMode = AttachToRemoteProcess;
|
sp.startMode = AttachToRemoteProcess;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
@@ -2731,8 +2728,9 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
|
|||||||
str.setIntegerBase(10);
|
str.setIntegerBase(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sp.debuggerCommand.isEmpty())
|
QString cmd = sp.debuggerCommand;
|
||||||
str << "Debugger: " << QDir::toNativeSeparators(sp.debuggerCommand) << '\n';
|
if (!cmd.isEmpty())
|
||||||
|
str << "Debugger: " << QDir::toNativeSeparators(cmd) << '\n';
|
||||||
if (!sp.coreFile.isEmpty())
|
if (!sp.coreFile.isEmpty())
|
||||||
str << "Core: " << QDir::toNativeSeparators(sp.coreFile) << '\n';
|
str << "Core: " << QDir::toNativeSeparators(sp.coreFile) << '\n';
|
||||||
if (sp.attachPID > 0)
|
if (sp.attachPID > 0)
|
||||||
@@ -2762,7 +2760,7 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
|
|||||||
}
|
}
|
||||||
if (!sp.gnuTarget.isEmpty())
|
if (!sp.gnuTarget.isEmpty())
|
||||||
str << "Gnu target: " << sp.gnuTarget << '\n';
|
str << "Gnu target: " << sp.gnuTarget << '\n';
|
||||||
str << "Sysroot: " << sp.sysroot << '\n';
|
str << "Sysroot: " << sp.sysRoot << '\n';
|
||||||
str << "Debug Source Location: " << sp.debugSourceLocation.join(QLatin1String(":")) << '\n';
|
str << "Debug Source Location: " << sp.debugSourceLocation.join(QLatin1String(":")) << '\n';
|
||||||
str << "Symbol file: " << sp.symbolFileName << '\n';
|
str << "Symbol file: " << sp.symbolFileName << '\n';
|
||||||
if (sp.useServerStartScript)
|
if (sp.useServerStartScript)
|
||||||
@@ -2819,61 +2817,6 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options,
|
|||||||
runScheduled();
|
runScheduled();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DebuggerPluginPrivate::debuggerForAbi(const Abi &abi, DebuggerEngineType et) const
|
|
||||||
{
|
|
||||||
enum { debug = 0 };
|
|
||||||
QList<Abi> searchAbis;
|
|
||||||
searchAbis.push_back(abi);
|
|
||||||
// Pick the right tool chain in case cdb/gdb were started with other tool chains.
|
|
||||||
// Also, lldb should be preferred over gdb.
|
|
||||||
if (abi.os() == Abi::WindowsOS) {
|
|
||||||
switch (et) {
|
|
||||||
case CdbEngineType:
|
|
||||||
searchAbis.clear();
|
|
||||||
searchAbis.push_back(Abi(abi.architecture(), abi.os(),
|
|
||||||
Abi::WindowsMsvc2010Flavor, abi.binaryFormat(), abi.wordWidth()));
|
|
||||||
searchAbis.push_back(Abi(abi.architecture(), abi.os(),
|
|
||||||
Abi::WindowsMsvc2008Flavor, abi.binaryFormat(), abi.wordWidth()));
|
|
||||||
searchAbis.push_back(Abi(abi.architecture(), abi.os(),
|
|
||||||
Abi::WindowsMsvc2005Flavor, abi.binaryFormat(), abi.wordWidth()));
|
|
||||||
break;
|
|
||||||
case GdbEngineType:
|
|
||||||
searchAbis.clear();
|
|
||||||
searchAbis.push_back(Abi(abi.architecture(), abi.os(),
|
|
||||||
Abi::WindowsMSysFlavor, abi.binaryFormat(), abi.wordWidth()));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (debug)
|
|
||||||
qDebug() << "debuggerForAbi" << abi.toString() << searchAbis.size()
|
|
||||||
<< searchAbis.front().toString() << et;
|
|
||||||
|
|
||||||
QList<Profile *> profileList = ProfileManager::instance()->profiles();
|
|
||||||
// Note: stList is not sorted with autodected first!
|
|
||||||
QStringList debuggerList;
|
|
||||||
foreach (Profile *p, profileList) {
|
|
||||||
if (!p->isValid())
|
|
||||||
continue;
|
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
|
||||||
if (!tc)
|
|
||||||
continue;
|
|
||||||
if (searchAbis.contains(tc->targetAbi())) {
|
|
||||||
const QString debugger = DebuggerProfileInformation::debuggerCommand(p).toString();
|
|
||||||
if (!debugger.isEmpty()) {
|
|
||||||
if (p->isAutoDetected())
|
|
||||||
debuggerList.append(debugger);
|
|
||||||
else
|
|
||||||
debuggerList.prepend(debugger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!debuggerList.isEmpty())
|
|
||||||
return debuggerList.at(0);
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
DebuggerLanguages DebuggerPluginPrivate::activeLanguages() const
|
DebuggerLanguages DebuggerPluginPrivate::activeLanguages() const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_mainWindow, return AnyLanguage);
|
QTC_ASSERT(m_mainWindow, return AnyLanguage);
|
||||||
@@ -3738,12 +3681,12 @@ static Target *activeTarget()
|
|||||||
return project->activeTarget();
|
return project->activeTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
static ToolChain *currentToolChain()
|
static Id currentProfileId()
|
||||||
{
|
{
|
||||||
Target *t = activeTarget();
|
Target *t = activeTarget();
|
||||||
if (!t || !t->isEnabled())
|
if (!t || !t->isEnabled())
|
||||||
return 0;
|
return 0;
|
||||||
return ToolChainProfileInformation::toolChain(activeTarget()->profile());
|
return activeTarget()->profile()->id();
|
||||||
}
|
}
|
||||||
|
|
||||||
static LocalApplicationRunConfiguration *activeLocalRunConfiguration()
|
static LocalApplicationRunConfiguration *activeLocalRunConfiguration()
|
||||||
@@ -3793,7 +3736,7 @@ void DebuggerPluginPrivate::testPythonDumpers1()
|
|||||||
void DebuggerPluginPrivate::testPythonDumpers2()
|
void DebuggerPluginPrivate::testPythonDumpers2()
|
||||||
{
|
{
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
sp.toolChainAbi = currentToolChain()->targetAbi();
|
fillParameters(&sp, currentProfileId());
|
||||||
sp.executable = activeLocalRunConfiguration()->executable();
|
sp.executable = activeLocalRunConfiguration()->executable();
|
||||||
testRunProject(sp, TestCallBack(this, "testPythonDumpers3"));
|
testRunProject(sp, TestCallBack(this, "testPythonDumpers3"));
|
||||||
}
|
}
|
||||||
@@ -3825,7 +3768,7 @@ void DebuggerPluginPrivate::testStateMachine1()
|
|||||||
void DebuggerPluginPrivate::testStateMachine2()
|
void DebuggerPluginPrivate::testStateMachine2()
|
||||||
{
|
{
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
sp.toolChainAbi = currentToolChain()->targetAbi();
|
fillParameters(&sp, currentProfileId());
|
||||||
sp.executable = activeLocalRunConfiguration()->executable();
|
sp.executable = activeLocalRunConfiguration()->executable();
|
||||||
sp.testCase = TestNoBoundsOfCurrentFunction;
|
sp.testCase = TestNoBoundsOfCurrentFunction;
|
||||||
testRunProject(sp, TestCallBack(this, "testStateMachine3"));
|
testRunProject(sp, TestCallBack(this, "testStateMachine3"));
|
||||||
|
@@ -158,7 +158,7 @@ static inline QString msgEngineNotAvailable(DebuggerEngineType et)
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class DebuggerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
class DebuggerRunConfigWidget : public RunConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ DebuggerRunControlPrivate::DebuggerRunControlPrivate(DebuggerRunControl *parent,
|
|||||||
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
|
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
|
||||||
const DebuggerStartParameters &sp,
|
const DebuggerStartParameters &sp,
|
||||||
const QPair<DebuggerEngineType, DebuggerEngineType> &masterSlaveEngineTypes)
|
const QPair<DebuggerEngineType, DebuggerEngineType> &masterSlaveEngineTypes)
|
||||||
: RunControl(runConfiguration, ProjectExplorer::DebugRunMode),
|
: RunControl(runConfiguration, DebugRunMode),
|
||||||
d(new DebuggerRunControlPrivate(this, runConfiguration))
|
d(new DebuggerRunControlPrivate(this, runConfiguration))
|
||||||
{
|
{
|
||||||
connect(this, SIGNAL(finished()), SLOT(handleFinished()));
|
connect(this, SIGNAL(finished()), SLOT(handleFinished()));
|
||||||
@@ -671,12 +671,6 @@ static QList<DebuggerEngineType> engineTypes(const DebuggerStartParameters &sp)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: 1 of 3 testing hacks.
|
|
||||||
if (sp.processArgs.startsWith(QLatin1String("@tcf@ "))) {
|
|
||||||
result.push_back(GdbEngineType);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sp.startMode != AttachToRemoteServer
|
if (sp.startMode != AttachToRemoteServer
|
||||||
&& sp.startMode != AttachToRemoteProcess
|
&& sp.startMode != AttachToRemoteProcess
|
||||||
&& sp.startMode != LoadRemoteCore
|
&& sp.startMode != LoadRemoteCore
|
||||||
@@ -743,8 +737,9 @@ static inline bool canUseEngine(DebuggerEngineType et,
|
|||||||
DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartParameters &sp)
|
DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartParameters &sp)
|
||||||
{
|
{
|
||||||
ConfigurationCheck result;
|
ConfigurationCheck result;
|
||||||
|
QString abi = sp.toolChainAbi.toString();
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug().nospace() << "checkDebugConfiguration " << sp.toolChainAbi.toString()
|
qDebug().nospace() << "checkDebugConfiguration " << abi
|
||||||
<< " Start mode=" << sp.startMode << " Executable=" << sp.executable
|
<< " Start mode=" << sp.startMode << " Executable=" << sp.executable
|
||||||
<< " Debugger command=" << sp.debuggerCommand;
|
<< " Debugger command=" << sp.debuggerCommand;
|
||||||
// Get all applicable types.
|
// Get all applicable types.
|
||||||
@@ -780,12 +775,12 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
|
|||||||
result.errorMessage = DebuggerPlugin::tr(
|
result.errorMessage = DebuggerPlugin::tr(
|
||||||
"The debugger engine '%1' required for debugging binaries of the type '%2'"
|
"The debugger engine '%1' required for debugging binaries of the type '%2'"
|
||||||
" is not configured correctly.").
|
" is not configured correctly.").
|
||||||
arg(QLatin1String(engineTypeName(requiredTypes.front())), sp.toolChainAbi.toString());
|
arg(QLatin1String(engineTypeName(requiredTypes.front())), abi);
|
||||||
} else {
|
} else {
|
||||||
result.errorMessage = DebuggerPlugin::tr(
|
result.errorMessage = DebuggerPlugin::tr(
|
||||||
"None of the debugger engines '%1' capable of debugging binaries of the type '%2'"
|
"None of the debugger engines '%1' capable of debugging binaries of the type '%2'"
|
||||||
" is configured correctly.").
|
" is configured correctly.").
|
||||||
arg(engineTypeNames(requiredTypes), sp.toolChainAbi.toString());
|
arg(engineTypeNames(requiredTypes), abi);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -796,7 +791,7 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
|
|||||||
const QString msg = DebuggerPlugin::tr(
|
const QString msg = DebuggerPlugin::tr(
|
||||||
"The preferred debugger engine for debugging binaries of type '%1' is not available.\n"
|
"The preferred debugger engine for debugging binaries of type '%1' is not available.\n"
|
||||||
"The debugger engine '%2' will be used as a fallback.\nDetails: %3").
|
"The debugger engine '%2' will be used as a fallback.\nDetails: %3").
|
||||||
arg(sp.toolChainAbi.toString(), QLatin1String(engineTypeName(usableType)),
|
arg(abi, QLatin1String(engineTypeName(usableType)),
|
||||||
result.errorDetails.join(QString(QLatin1Char('\n'))));
|
result.errorDetails.join(QString(QLatin1Char('\n'))));
|
||||||
debuggerCore()->showMessage(msg, LogWarning);
|
debuggerCore()->showMessage(msg, LogWarning);
|
||||||
showMessageBox(QMessageBox::Warning, DebuggerPlugin::tr("Warning"), msg);
|
showMessageBox(QMessageBox::Warning, DebuggerPlugin::tr("Warning"), msg);
|
||||||
@@ -880,6 +875,9 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||||
QTC_ASSERT(rc, return sp);
|
QTC_ASSERT(rc, return sp);
|
||||||
|
|
||||||
|
Target *target = runConfiguration->target();
|
||||||
|
Profile *profile = target ? target->profile() : ProfileManager::instance()->defaultProfile();
|
||||||
|
fillParameters(&sp, profile->id());
|
||||||
sp.environment = rc->environment();
|
sp.environment = rc->environment();
|
||||||
sp.workingDirectory = rc->workingDirectory();
|
sp.workingDirectory = rc->workingDirectory();
|
||||||
|
|
||||||
@@ -893,17 +891,11 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
return sp;
|
return sp;
|
||||||
sp.startMode = StartInternal;
|
sp.startMode = StartInternal;
|
||||||
sp.processArgs = rc->commandLineArguments();
|
sp.processArgs = rc->commandLineArguments();
|
||||||
sp.toolChainAbi = rc->abi();
|
|
||||||
if (!sp.toolChainAbi.isValid()) {
|
|
||||||
QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(sp.executable));
|
|
||||||
if (!abis.isEmpty())
|
|
||||||
sp.toolChainAbi = abis.at(0);
|
|
||||||
}
|
|
||||||
sp.useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
|
sp.useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
|
||||||
sp.dumperLibrary = rc->dumperLibrary();
|
sp.dumperLibrary = rc->dumperLibrary();
|
||||||
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
|
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
|
||||||
|
|
||||||
if (const ProjectExplorer::Target *target = runConfiguration->target()) {
|
if (target) {
|
||||||
if (QByteArray(target->metaObject()->className()).contains("Qt4")) {
|
if (QByteArray(target->metaObject()->className()).contains("Qt4")) {
|
||||||
// FIXME: Get this from the profile?
|
// FIXME: Get this from the profile?
|
||||||
// We could query the QtVersion for this information directly, but then we
|
// We could query the QtVersion for this information directly, but then we
|
||||||
@@ -915,13 +907,10 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
if (!qmake.isEmpty())
|
if (!qmake.isEmpty())
|
||||||
sp.qtInstallPath = findQtInstallPath(qmake);
|
sp.qtInstallPath = findQtInstallPath(qmake);
|
||||||
}
|
}
|
||||||
if (const ProjectExplorer::Project *project = target->project()) {
|
if (const Project *project = target->project()) {
|
||||||
sp.projectSourceDirectory = project->projectDirectory();
|
sp.projectSourceDirectory = project->projectDirectory();
|
||||||
if (const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration()) {
|
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
|
||||||
sp.projectBuildDirectory = buildConfig->buildDirectory();
|
sp.projectBuildDirectory = buildConfig->buildDirectory();
|
||||||
const ProjectExplorer::Profile *p = runConfiguration->target()->profile();
|
|
||||||
sp.debuggerCommand = DebuggerProfileInformation::debuggerCommand(p).toString();
|
|
||||||
}
|
|
||||||
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
|
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include "debugger_global.h"
|
#include "debugger_global.h"
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
|
#include <coreplugin/id.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
@@ -77,6 +78,12 @@ public:
|
|||||||
testCase(0)
|
testCase(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//Core::Id profileId;
|
||||||
|
|
||||||
|
QString sysRoot;
|
||||||
|
QString debuggerCommand;
|
||||||
|
ProjectExplorer::Abi toolChainAbi;
|
||||||
|
|
||||||
QString executable;
|
QString executable;
|
||||||
QString displayName; // Used in the Snapshots view.
|
QString displayName; // Used in the Snapshots view.
|
||||||
QString startMessage; // First status message shown.
|
QString startMessage; // First status message shown.
|
||||||
@@ -111,7 +118,7 @@ public:
|
|||||||
QString symbolFileName;
|
QString symbolFileName;
|
||||||
bool useServerStartScript;
|
bool useServerStartScript;
|
||||||
QString serverStartScript;
|
QString serverStartScript;
|
||||||
QString sysroot;
|
//QString sysroot;
|
||||||
QString searchPath; // Gdb "set solib-search-path"
|
QString searchPath; // Gdb "set solib-search-path"
|
||||||
QString debugInfoLocation; // Gdb "set-debug-file-directory".
|
QString debugInfoLocation; // Gdb "set-debug-file-directory".
|
||||||
QStringList debugSourceLocation; // Gdb "directory"
|
QStringList debugSourceLocation; // Gdb "directory"
|
||||||
@@ -122,8 +129,8 @@ public:
|
|||||||
QSsh::SshConnectionParameters connParams;
|
QSsh::SshConnectionParameters connParams;
|
||||||
bool remoteSetupNeeded;
|
bool remoteSetupNeeded;
|
||||||
|
|
||||||
QString debuggerCommand;
|
//QString debuggerCommand;
|
||||||
ProjectExplorer::Abi toolChainAbi;
|
//ProjectExplorer::Abi toolChainAbi;
|
||||||
|
|
||||||
QString dumperLibrary;
|
QString dumperLibrary;
|
||||||
QStringList solibSearchPath;
|
QStringList solibSearchPath;
|
||||||
@@ -143,6 +150,11 @@ public:
|
|||||||
int testCase;
|
int testCase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
void fillParameters(DebuggerStartParameters *sp, Core::Id id);
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
|
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
|
||||||
|
@@ -47,14 +47,13 @@
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
DebuggerToolChainComboBox::DebuggerToolChainComboBox(QWidget *parent) :
|
ProfileChooser::ProfileChooser(QWidget *parent) :
|
||||||
QComboBox(parent)
|
QComboBox(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerToolChainComboBox::init(bool hostAbiOnly)
|
void ProfileChooser::init(bool hostAbiOnly)
|
||||||
{
|
{
|
||||||
const Abi hostAbi = Abi::hostAbi();
|
const Abi hostAbi = Abi::hostAbi();
|
||||||
foreach (const Profile *st, ProfileManager::instance()->profiles()) {
|
foreach (const Profile *st, ProfileManager::instance()->profiles()) {
|
||||||
@@ -85,23 +84,12 @@ void DebuggerToolChainComboBox::init(bool hostAbiOnly)
|
|||||||
setEnabled(count() > 1);
|
setEnabled(count() > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerToolChainComboBox::setCurrentProfile(const Profile *profile)
|
Profile *ProfileChooser::currentProfile() const
|
||||||
{
|
|
||||||
QTC_ASSERT(profile->isValid(), return);
|
|
||||||
for (int i = 0, n = count(); i != n; ++i) {
|
|
||||||
if (profileAt(i) == profile) {
|
|
||||||
setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Profile *DebuggerToolChainComboBox::currentProfile() const
|
|
||||||
{
|
{
|
||||||
return profileAt(currentIndex());
|
return profileAt(currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerToolChainComboBox::setCurrentProfileId(Core::Id id)
|
void ProfileChooser::setCurrentProfileId(Core::Id id)
|
||||||
{
|
{
|
||||||
for (int i = 0, n = count(); i != n; ++i) {
|
for (int i = 0, n = count(); i != n; ++i) {
|
||||||
if (profileAt(i)->id() == id) {
|
if (profileAt(i)->id() == id) {
|
||||||
@@ -111,16 +99,15 @@ void DebuggerToolChainComboBox::setCurrentProfileId(Core::Id id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id DebuggerToolChainComboBox::currentProfileId() const
|
Core::Id ProfileChooser::currentProfileId() const
|
||||||
{
|
{
|
||||||
return profileAt(currentIndex())->id();
|
return profileAt(currentIndex())->id();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *DebuggerToolChainComboBox::profileAt(int index) const
|
Profile *ProfileChooser::profileAt(int index) const
|
||||||
{
|
{
|
||||||
Core::Id id = qvariant_cast<Core::Id>(itemData(index));
|
Core::Id id = qvariant_cast<Core::Id>(itemData(index));
|
||||||
return ProfileManager::instance()->find(id);
|
return ProfileManager::instance()->find(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
} // namespace Internal
|
|
||||||
|
@@ -33,28 +33,28 @@
|
|||||||
#ifndef DEBUGGERTOOLCHAINCOMBOBOX_H
|
#ifndef DEBUGGERTOOLCHAINCOMBOBOX_H
|
||||||
#define DEBUGGERTOOLCHAINCOMBOBOX_H
|
#define DEBUGGERTOOLCHAINCOMBOBOX_H
|
||||||
|
|
||||||
|
#include "debugger_global.h"
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
|
||||||
namespace Core { class Id; }
|
namespace Core { class Id; }
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Profile; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// Let the user pick a profile associated with a debugger.
|
// Let the user pick a profile.
|
||||||
class DebuggerToolChainComboBox : public QComboBox
|
class DEBUGGER_EXPORT ProfileChooser : public QComboBox
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DebuggerToolChainComboBox(QWidget *parent);
|
explicit ProfileChooser(QWidget *parent);
|
||||||
|
|
||||||
void init(bool hostAbiOnly);
|
void init(bool hostAbiOnly);
|
||||||
|
|
||||||
void setCurrentProfileId(Core::Id id);
|
void setCurrentProfileId(Core::Id id);
|
||||||
Core::Id currentProfileId() const;
|
Core::Id currentProfileId() const;
|
||||||
|
|
||||||
void setCurrentProfile(const ProjectExplorer::Profile *profile);
|
|
||||||
ProjectExplorer::Profile *currentProfile() const;
|
ProjectExplorer::Profile *currentProfile() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -62,6 +62,5 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
#endif // DEBUGGERTOOLCHAINCOMBOBOX_H
|
#endif // DEBUGGERTOOLCHAINCOMBOBOX_H
|
||||||
|
@@ -32,12 +32,13 @@
|
|||||||
|
|
||||||
#include "disassembleragent.h"
|
#include "disassembleragent.h"
|
||||||
|
|
||||||
#include "disassemblerlines.h"
|
|
||||||
#include "breakhandler.h"
|
#include "breakhandler.h"
|
||||||
|
#include "debuggercore.h"
|
||||||
#include "debuggerengine.h"
|
#include "debuggerengine.h"
|
||||||
#include "debuggerinternalconstants.h"
|
#include "debuggerinternalconstants.h"
|
||||||
#include "debuggercore.h"
|
#include "debuggerstartparameters.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
|
#include "disassemblerlines.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
@@ -45,6 +46,8 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/abi.h>
|
||||||
|
|
||||||
#include <texteditor/basetextdocument.h>
|
#include <texteditor/basetextdocument.h>
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
#include <texteditor/basetextmark.h>
|
#include <texteditor/basetextmark.h>
|
||||||
@@ -116,6 +119,7 @@ public:
|
|||||||
QList<ITextMark *> breakpointMarks;
|
QList<ITextMark *> breakpointMarks;
|
||||||
QList<CacheEntry> cache;
|
QList<CacheEntry> cache;
|
||||||
QString mimeType;
|
QString mimeType;
|
||||||
|
bool tryMixedInitialized;
|
||||||
bool tryMixed;
|
bool tryMixed;
|
||||||
bool resetLocationScheduled;
|
bool resetLocationScheduled;
|
||||||
};
|
};
|
||||||
@@ -124,6 +128,7 @@ DisassemblerAgentPrivate::DisassemblerAgentPrivate()
|
|||||||
: editor(0),
|
: editor(0),
|
||||||
locationMark(0),
|
locationMark(0),
|
||||||
mimeType(_("text/x-qtcreator-generic-asm")),
|
mimeType(_("text/x-qtcreator-generic-asm")),
|
||||||
|
tryMixedInitialized(false),
|
||||||
tryMixed(true),
|
tryMixed(true),
|
||||||
resetLocationScheduled(false)
|
resetLocationScheduled(false)
|
||||||
{
|
{
|
||||||
@@ -214,6 +219,12 @@ const Location &DisassemblerAgent::location() const
|
|||||||
|
|
||||||
bool DisassemblerAgent::isMixed() const
|
bool DisassemblerAgent::isMixed() const
|
||||||
{
|
{
|
||||||
|
if (!d->tryMixedInitialized) {
|
||||||
|
if (d->engine->startParameters().toolChainAbi.os() == ProjectExplorer::Abi::MacOS)
|
||||||
|
d->tryMixed = false;
|
||||||
|
d->tryMixedInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
return d->tryMixed
|
return d->tryMixed
|
||||||
&& d->location.lineNumber() > 0
|
&& d->location.lineNumber() > 0
|
||||||
&& !d->location.functionName().isEmpty()
|
&& !d->location.functionName().isEmpty()
|
||||||
@@ -406,10 +417,5 @@ quint64 DisassemblerAgent::address() const
|
|||||||
return d->location.address();
|
return d->location.address();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblerAgent::setTryMixed(bool on)
|
|
||||||
{
|
|
||||||
d->tryMixed = on;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -53,7 +53,6 @@ public:
|
|||||||
explicit DisassemblerAgent(DebuggerEngine *engine);
|
explicit DisassemblerAgent(DebuggerEngine *engine);
|
||||||
~DisassemblerAgent();
|
~DisassemblerAgent();
|
||||||
|
|
||||||
void setTryMixed(bool on);
|
|
||||||
void setLocation(const Location &location);
|
void setLocation(const Location &location);
|
||||||
const Location &location() const;
|
const Location &location() const;
|
||||||
void scheduleResetLocation();
|
void scheduleResetLocation();
|
||||||
|
@@ -1182,7 +1182,8 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
|
|||||||
|
|
||||||
if (!isExpectedResult) {
|
if (!isExpectedResult) {
|
||||||
const DebuggerStartParameters &sp = startParameters();
|
const DebuggerStartParameters &sp = startParameters();
|
||||||
if (sp.toolChainAbi.os() == Abi::WindowsOS
|
Abi abi = sp.toolChainAbi;
|
||||||
|
if (abi.os() == Abi::WindowsOS
|
||||||
&& cmd.command.startsWith("attach")
|
&& cmd.command.startsWith("attach")
|
||||||
&& (sp.startMode == AttachExternal || sp.useTerminal))
|
&& (sp.startMode == AttachExternal || sp.useTerminal))
|
||||||
{
|
{
|
||||||
@@ -1628,7 +1629,6 @@ void GdbEngine::handleStop2(const GdbMi &data)
|
|||||||
const QByteArray reason = data.findChild("reason").data();
|
const QByteArray reason = data.findChild("reason").data();
|
||||||
const QByteArray func = data.findChild("frame").findChild("from").data();
|
const QByteArray func = data.findChild("frame").findChild("from").data();
|
||||||
const DebuggerStartParameters &sp = startParameters();
|
const DebuggerStartParameters &sp = startParameters();
|
||||||
const Abi abi = sp.toolChainAbi;
|
|
||||||
|
|
||||||
bool isStopperThread = false;
|
bool isStopperThread = false;
|
||||||
|
|
||||||
@@ -1644,7 +1644,7 @@ void GdbEngine::handleStop2(const GdbMi &data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abi.os() == Abi::WindowsOS
|
if (sp.toolChainAbi.os() == Abi::WindowsOS
|
||||||
&& sp.useTerminal
|
&& sp.useTerminal
|
||||||
&& reason == "signal-received"
|
&& reason == "signal-received"
|
||||||
&& data.findChild("signal-name").data() == "SIGTRAP")
|
&& data.findChild("signal-name").data() == "SIGTRAP")
|
||||||
@@ -1934,7 +1934,7 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
|
|||||||
if (!debuggerCore()->boolSetting(AutoEnrichParameters))
|
if (!debuggerCore()->boolSetting(AutoEnrichParameters))
|
||||||
return cleanFilePath;
|
return cleanFilePath;
|
||||||
|
|
||||||
const QString sysroot = startParameters().sysroot;
|
const QString sysroot = startParameters().sysRoot;
|
||||||
if (QFileInfo(cleanFilePath).isReadable())
|
if (QFileInfo(cleanFilePath).isReadable())
|
||||||
return cleanFilePath;
|
return cleanFilePath;
|
||||||
if (!sysroot.isEmpty() && fileName.startsWith(QLatin1Char('/'))) {
|
if (!sysroot.isEmpty() && fileName.startsWith(QLatin1Char('/'))) {
|
||||||
@@ -2068,6 +2068,7 @@ void GdbEngine::handleThreadGroupCreated(const GdbMi &result)
|
|||||||
{
|
{
|
||||||
QByteArray id = result.findChild("id").data();
|
QByteArray id = result.findChild("id").data();
|
||||||
QByteArray pid = result.findChild("pid").data();
|
QByteArray pid = result.findChild("pid").data();
|
||||||
|
Q_UNUSED(id);
|
||||||
Q_UNUSED(pid);
|
Q_UNUSED(pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2081,7 +2082,7 @@ int GdbEngine::currentFrame() const
|
|||||||
return stackHandler()->currentIndex();
|
return stackHandler()->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString msgNoGdbBinaryForToolChain(const Abi &tc)
|
static QString msgNoGdbBinaryForToolChain(const Abi &tc)
|
||||||
{
|
{
|
||||||
return GdbEngine::tr("There is no gdb binary available for binaries in format '%1'")
|
return GdbEngine::tr("There is no gdb binary available for binaries in format '%1'")
|
||||||
.arg(tc.toString());
|
.arg(tc.toString());
|
||||||
@@ -4634,27 +4635,21 @@ static QString gdbBinary(const DebuggerStartParameters &sp)
|
|||||||
const QByteArray envBinary = qgetenv("QTC_DEBUGGER_PATH");
|
const QByteArray envBinary = qgetenv("QTC_DEBUGGER_PATH");
|
||||||
if (!envBinary.isEmpty())
|
if (!envBinary.isEmpty())
|
||||||
return QString::fromLocal8Bit(envBinary);
|
return QString::fromLocal8Bit(envBinary);
|
||||||
// 2) Command explicitly specified.
|
// 2) Command from profile.
|
||||||
if (!sp.debuggerCommand.isEmpty()) {
|
|
||||||
// Do not use a CDB binary if we got started for a project with MSVC runtime.
|
|
||||||
const Abi abi = sp.toolChainAbi;
|
|
||||||
if (abi.os() != Abi::WindowsOS || abi.osFlavor() == Abi::WindowsMSysFlavor)
|
|
||||||
return sp.debuggerCommand;
|
return sp.debuggerCommand;
|
||||||
}
|
|
||||||
// 3) Find one from tool chains.
|
|
||||||
return debuggerCore()->debuggerForAbi(sp.toolChainAbi, GdbEngineType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
|
bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
|
||||||
{
|
{
|
||||||
const QString binary = gdbBinary(sp);
|
const QString binary = gdbBinary(sp);
|
||||||
if (gdbBinary(sp).isEmpty()) {
|
const Abi abi = sp.toolChainAbi;
|
||||||
check->errorDetails.push_back(msgNoGdbBinaryForToolChain(sp.toolChainAbi));
|
if (binary.isEmpty()) {
|
||||||
|
check->errorDetails.push_back(msgNoGdbBinaryForToolChain(abi));
|
||||||
check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
||||||
check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sp.toolChainAbi.os() == Abi::WindowsOS && !QFileInfo(binary).isAbsolute()) {
|
if (abi.os() == Abi::WindowsOS && !QFileInfo(binary).isAbsolute()) {
|
||||||
// See initialization below, we need an absolute path to be able to locate Python on Windows.
|
// See initialization below, we need an absolute path to be able to locate Python on Windows.
|
||||||
check->errorDetails.push_back(GdbEngine::tr("The gdb location must be given as an "
|
check->errorDetails.push_back(GdbEngine::tr("The gdb location must be given as an "
|
||||||
"absolute path in the debugger settings (%1).").arg(binary));
|
"absolute path in the debugger settings (%1).").arg(binary));
|
||||||
@@ -4818,7 +4813,7 @@ void GdbEngine::startGdb(const QStringList &args)
|
|||||||
foreach (const QString &src, sp.debugSourceLocation)
|
foreach (const QString &src, sp.debugSourceLocation)
|
||||||
postCommand("directory " + src.toLocal8Bit());
|
postCommand("directory " + src.toLocal8Bit());
|
||||||
|
|
||||||
const QByteArray sysroot = sp.sysroot.toLocal8Bit();
|
const QByteArray sysroot = sp.sysRoot.toLocal8Bit();
|
||||||
if (!sysroot.isEmpty()) {
|
if (!sysroot.isEmpty()) {
|
||||||
postCommand("set sysroot " + sysroot);
|
postCommand("set sysroot " + sysroot);
|
||||||
// sysroot is not enough to correctly locate the sources, so explicitly
|
// sysroot is not enough to correctly locate the sources, so explicitly
|
||||||
|
@@ -105,11 +105,12 @@ void GdbRemotePlainEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qm
|
|||||||
Q_UNUSED(gdbServerPort);
|
Q_UNUSED(gdbServerPort);
|
||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
|
|
||||||
|
DebuggerStartParameters &sp = startParameters();
|
||||||
if (qmlPort != -1)
|
if (qmlPort != -1)
|
||||||
startParameters().qmlServerPort = qmlPort;
|
sp.qmlServerPort = qmlPort;
|
||||||
m_gdbProc.realStart(startParameters().debuggerCommand,
|
m_gdbProc.realStart(sp.debuggerCommand,
|
||||||
QStringList() << QLatin1String("-i") << QLatin1String("mi"),
|
QStringList() << QLatin1String("-i") << QLatin1String("mi"),
|
||||||
startParameters().executable);
|
sp.executable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbRemotePlainEngine::handleGdbStarted()
|
void GdbRemotePlainEngine::handleGdbStarted()
|
||||||
|
@@ -31,9 +31,11 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "loadremotecoredialog.h"
|
#include "loadremotecoredialog.h"
|
||||||
#include "debuggerstartparameters.h"
|
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
#include "debuggercore.h"
|
#include "debuggercore.h"
|
||||||
|
#include "debuggerstartparameters.h"
|
||||||
|
#include "debuggertoolchaincombobox.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
@@ -93,7 +95,8 @@ public:
|
|||||||
QPushButton *loadCoreFileButton;
|
QPushButton *loadCoreFileButton;
|
||||||
QTextBrowser *textBrowser;
|
QTextBrowser *textBrowser;
|
||||||
QPushButton *closeButton;
|
QPushButton *closeButton;
|
||||||
PathChooser *sysrootPathChooser;
|
//PathChooser *sysrootPathChooser;
|
||||||
|
ProfileChooser *toolchainComboBox;
|
||||||
|
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
QString remoteCommandLine;
|
QString remoteCommandLine;
|
||||||
@@ -113,11 +116,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent)
|
|||||||
|
|
||||||
d->deviceComboBox = new QComboBox(this);
|
d->deviceComboBox = new QComboBox(this);
|
||||||
|
|
||||||
d->sysrootPathChooser = new PathChooser(this);
|
d->toolchainComboBox = new ProfileChooser(this);
|
||||||
d->sysrootPathChooser->setExpectedKind(PathChooser::Directory);
|
|
||||||
d->sysrootPathChooser->setPromptDialogTitle(tr("Select Sysroot"));
|
|
||||||
d->sysrootPathChooser->setPath(d->settings->value(QLatin1String("LastSysroot")).toString());
|
|
||||||
|
|
||||||
d->fileSystemModel = new SftpFileSystemModel(this);
|
d->fileSystemModel = new SftpFileSystemModel(this);
|
||||||
|
|
||||||
//executablePathChooser = new PathChooser(q);
|
//executablePathChooser = new PathChooser(q);
|
||||||
@@ -143,7 +142,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent)
|
|||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
formLayout->addRow(tr("Device:"), d->deviceComboBox);
|
formLayout->addRow(tr("Device:"), d->deviceComboBox);
|
||||||
formLayout->addRow(tr("Sysroot:"), d->sysrootPathChooser);
|
formLayout->addRow(tr("Profile:"), d->toolchainComboBox);
|
||||||
|
|
||||||
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
|
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
|
||||||
horizontalLayout2->addStretch(1);
|
horizontalLayout2->addStretch(1);
|
||||||
@@ -169,8 +168,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent)
|
|||||||
connect(d->fileSystemView->selectionModel(),
|
connect(d->fileSystemView->selectionModel(),
|
||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||||
SLOT(updateButtons()));
|
SLOT(updateButtons()));
|
||||||
connect(d->sysrootPathChooser, SIGNAL(changed(QString)),
|
connect(d->toolchainComboBox, SIGNAL(activated(int)), SLOT(updateButtons()));
|
||||||
SLOT(updateButtons()));
|
|
||||||
connect(d->loadCoreFileButton, SIGNAL(clicked()), SLOT(selectCoreFile()));
|
connect(d->loadCoreFileButton, SIGNAL(clicked()), SLOT(selectCoreFile()));
|
||||||
connect(d->deviceComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(d->deviceComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
SLOT(attachToDevice(int)));
|
SLOT(attachToDevice(int)));
|
||||||
@@ -194,9 +192,9 @@ QString LoadRemoteCoreFileDialog::localCoreFileName() const
|
|||||||
return d->localCoreFile;
|
return d->localCoreFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LoadRemoteCoreFileDialog::sysroot() const
|
Id LoadRemoteCoreFileDialog::profileId() const
|
||||||
{
|
{
|
||||||
return d->sysrootPathChooser->path();
|
return d->toolchainComboBox->currentProfileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadRemoteCoreFileDialog::attachToDevice(int modelIndex)
|
void LoadRemoteCoreFileDialog::attachToDevice(int modelIndex)
|
||||||
@@ -251,7 +249,8 @@ void LoadRemoteCoreFileDialog::selectCoreFile()
|
|||||||
d->loadCoreFileButton->setEnabled(false);
|
d->loadCoreFileButton->setEnabled(false);
|
||||||
d->fileSystemView->setEnabled(false);
|
d->fileSystemView->setEnabled(false);
|
||||||
|
|
||||||
d->settings->setValue(QLatin1String("LastSysroot"), d->sysrootPathChooser->path());
|
d->settings->setValue(QLatin1String("LastProfile"),
|
||||||
|
d->toolchainComboBox->currentProfileId().toString());
|
||||||
d->settings->setValue(QLatin1String("LastDevice"), d->deviceComboBox->currentIndex());
|
d->settings->setValue(QLatin1String("LastDevice"), d->deviceComboBox->currentIndex());
|
||||||
d->settings->setValue(QLatin1String("LastSftpRoot"), d->fileSystemModel->rootDirectory());
|
d->settings->setValue(QLatin1String("LastSftpRoot"), d->fileSystemModel->rootDirectory());
|
||||||
|
|
||||||
|
@@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Core { class Id; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ public:
|
|||||||
|
|
||||||
void setLocalCoreFileName(const QString &fileName);
|
void setLocalCoreFileName(const QString &fileName);
|
||||||
QString localCoreFileName() const;
|
QString localCoreFileName() const;
|
||||||
QString sysroot() const;
|
Core::Id profileId() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleSftpOperationFinished(QSsh::SftpJobId, const QString &error);
|
void handleSftpOperationFinished(QSsh::SftpJobId, const QString &error);
|
||||||
|
@@ -80,7 +80,7 @@
|
|||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="toolChainLabel">
|
<widget class="QLabel" name="toolChainLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Tool chain:</string>
|
<string>&Target:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>toolChainComboBox</cstring>
|
<cstring>toolChainComboBox</cstring>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolChainComboBox"/>
|
<widget class="Debugger::ProfileChooser" name="toolChainComboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="labelBreakAtMain">
|
<widget class="QLabel" name="labelBreakAtMain">
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
</slots>
|
</slots>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Debugger::Internal::DebuggerToolChainComboBox</class>
|
<class>Debugger::ProfileChooser</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>debuggertoolchaincombobox.h</header>
|
<header>debuggertoolchaincombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolchainComboBox"/>
|
<widget class="Debugger::ProfileChooser" name="toolchainComboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="executableLabel">
|
<widget class="QLabel" name="executableLabel">
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
</slots>
|
</slots>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Debugger::Internal::DebuggerToolChainComboBox</class>
|
<class>Debugger::ProfileChooser</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>debuggertoolchaincombobox.h</header>
|
<header>debuggertoolchaincombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
#include <projectexplorer/profile.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -215,9 +216,6 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
|
|||||||
if (runConfig->debuggerAspect()->useCppDebugger())
|
if (runConfig->debuggerAspect()->useCppDebugger())
|
||||||
params.languages |= Debugger::CppLanguage;
|
params.languages |= Debugger::CppLanguage;
|
||||||
|
|
||||||
if (!runConfig->qtVersion()->qtAbis().isEmpty())
|
|
||||||
params.toolChainAbi = runConfig->qtVersion()->qtAbis().first();
|
|
||||||
|
|
||||||
// Makes sure that all bindings go through the JavaScript engine, so that
|
// Makes sure that all bindings go through the JavaScript engine, so that
|
||||||
// breakpoints are actually hit!
|
// breakpoints are actually hit!
|
||||||
const QString optimizerKey = QLatin1String("QML_DISABLE_OPTIMIZER");
|
const QString optimizerKey = QLatin1String("QML_DISABLE_OPTIMIZER");
|
||||||
|
@@ -39,8 +39,11 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <debugger/debuggerengine.h>
|
#include <debugger/debuggerengine.h>
|
||||||
|
#include <debugger/debuggerprofileinformation.h>
|
||||||
#include <debugger/debuggerstartparameters.h>
|
#include <debugger/debuggerstartparameters.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/profile.h>
|
||||||
|
#include <projectexplorer/profileinformation.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -80,35 +83,41 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
|
|||||||
qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration());
|
qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration());
|
||||||
QTC_ASSERT(activeDeployConf, return sp);
|
QTC_ASSERT(activeDeployConf, return sp);
|
||||||
|
|
||||||
|
DebuggerRunConfigurationAspect *debuggerAspect = rc->debuggerAspect();
|
||||||
|
|
||||||
const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe")
|
const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe")
|
||||||
.arg(activeDeployConf->installationDrive()).arg(rc->targetName());
|
.arg(activeDeployConf->installationDrive()).arg(rc->targetName());
|
||||||
|
|
||||||
|
Profile *profile = rc->target()->profile();
|
||||||
|
sp.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
|
sp.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||||
|
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
|
||||||
|
sp.toolChainAbi = tc->targetAbi();
|
||||||
SymbianIDevice::ConstPtr dev = activeDeployConf->device();
|
SymbianIDevice::ConstPtr dev = activeDeployConf->device();
|
||||||
sp.remoteChannel = dev->serialPortName();
|
sp.remoteChannel = dev->serialPortName();
|
||||||
sp.processArgs = rc->commandLineArguments();
|
sp.processArgs = rc->commandLineArguments();
|
||||||
if (rc->debuggerAspect()->useQmlDebugger() && !rc->debuggerAspect()->useCppDebugger()) {
|
if (debuggerAspect->useQmlDebugger() && !debuggerAspect->useCppDebugger()) {
|
||||||
sp.remoteSetupNeeded = true;
|
sp.remoteSetupNeeded = true;
|
||||||
sp.startMode = Debugger::AttachToRemoteServer;
|
sp.startMode = Debugger::AttachToRemoteServer;
|
||||||
} else {
|
} else {
|
||||||
sp.startMode = Debugger::StartInternal;
|
sp.startMode = Debugger::StartInternal;
|
||||||
}
|
}
|
||||||
|
|
||||||
sp.toolChainAbi = rc->abi();
|
|
||||||
sp.executable = debugFileName;
|
sp.executable = debugFileName;
|
||||||
sp.executableUid = rc->executableUid();
|
sp.executableUid = rc->executableUid();
|
||||||
sp.serverAddress = dev->address();
|
sp.serverAddress = dev->address();
|
||||||
sp.serverPort = dev->port().toInt();
|
sp.serverPort = dev->port().toInt();
|
||||||
sp.displayName = rc->displayName();
|
sp.displayName = rc->displayName();
|
||||||
sp.qmlServerAddress = dev->address();
|
sp.qmlServerAddress = dev->address();
|
||||||
sp.qmlServerPort = rc->debuggerAspect()->qmlDebugServerPort();
|
sp.qmlServerPort = debuggerAspect->qmlDebugServerPort();
|
||||||
if (rc->debuggerAspect()->useQmlDebugger()) {
|
if (debuggerAspect->useQmlDebugger()) {
|
||||||
sp.languages |= Debugger::QmlLanguage;
|
sp.languages |= Debugger::QmlLanguage;
|
||||||
QString qmlArgs = rc->qmlCommandLineArguments();
|
QString qmlArgs = rc->qmlCommandLineArguments();
|
||||||
if (sp.processArgs.length())
|
if (sp.processArgs.length())
|
||||||
sp.processArgs.prepend(QLatin1Char(' '));
|
sp.processArgs.prepend(QLatin1Char(' '));
|
||||||
sp.processArgs.prepend(qmlArgs);
|
sp.processArgs.prepend(qmlArgs);
|
||||||
}
|
}
|
||||||
if (rc->debuggerAspect()->useCppDebugger())
|
if (debuggerAspect->useCppDebugger())
|
||||||
sp.languages |= Debugger::CppLanguage;
|
sp.languages |= Debugger::CppLanguage;
|
||||||
|
|
||||||
sp.communicationChannel = dev->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection?
|
sp.communicationChannel = dev->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection?
|
||||||
|
@@ -97,9 +97,17 @@ using namespace Internal;
|
|||||||
DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig)
|
DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig)
|
||||||
{
|
{
|
||||||
DebuggerStartParameters params;
|
DebuggerStartParameters params;
|
||||||
|
Target *target = runConfig->target();
|
||||||
|
Profile *profile = target->profile();
|
||||||
const LinuxDeviceConfiguration::ConstPtr devConf
|
const LinuxDeviceConfiguration::ConstPtr devConf
|
||||||
= DeviceProfileInformation::device(runConfig->target()->profile())
|
= DeviceProfileInformation::device(profile)
|
||||||
.dynamicCast<const RemoteLinux::LinuxDeviceConfiguration>();
|
.dynamicCast<const RemoteLinux::LinuxDeviceConfiguration>();
|
||||||
|
|
||||||
|
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
|
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||||
|
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
|
||||||
|
params.toolChainAbi = tc->targetAbi();
|
||||||
|
|
||||||
if (runConfig->debuggerAspect()->useQmlDebugger()) {
|
if (runConfig->debuggerAspect()->useQmlDebugger()) {
|
||||||
params.languages |= QmlLanguage;
|
params.languages |= QmlLanguage;
|
||||||
params.qmlServerAddress = devConf->sshParameters().host;
|
params.qmlServerAddress = devConf->sshParameters().host;
|
||||||
@@ -108,18 +116,12 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
|
|||||||
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
||||||
params.languages |= CppLanguage;
|
params.languages |= CppLanguage;
|
||||||
params.processArgs = runConfig->arguments();
|
params.processArgs = runConfig->arguments();
|
||||||
QString systemRoot;
|
|
||||||
if (SysRootProfileInformation::hasSysRoot(runConfig->target()->profile()))
|
|
||||||
systemRoot = SysRootProfileInformation::sysRoot(runConfig->target()->profile()).toString();
|
|
||||||
params.sysroot = systemRoot;
|
|
||||||
params.toolChainAbi = runConfig->abi();
|
|
||||||
params.startMode = AttachToRemoteServer;
|
params.startMode = AttachToRemoteServer;
|
||||||
params.executable = runConfig->localExecutableFilePath();
|
params.executable = runConfig->localExecutableFilePath();
|
||||||
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(runConfig->target()->profile()).toString();
|
|
||||||
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
|
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
|
||||||
|
|
||||||
// TODO: This functionality should be inside the debugger.
|
// TODO: This functionality should be inside the debugger.
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(runConfig->target()->profile());
|
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||||
if (tc) {
|
if (tc) {
|
||||||
const Abi &abi = tc->targetAbi();
|
const Abi &abi = tc->targetAbi();
|
||||||
params.remoteArchitecture = abi.toString();
|
params.remoteArchitecture = abi.toString();
|
||||||
@@ -132,9 +134,9 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
|
|||||||
params.remoteSetupNeeded = true;
|
params.remoteSetupNeeded = true;
|
||||||
params.displayName = runConfig->displayName();
|
params.displayName = runConfig->displayName();
|
||||||
|
|
||||||
if (const Project *project = runConfig->target()->project()) {
|
if (const Project *project = target->project()) {
|
||||||
params.projectSourceDirectory = project->projectDirectory();
|
params.projectSourceDirectory = project->projectDirectory();
|
||||||
if (const BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration())
|
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
|
||||||
params.projectBuildDirectory = buildConfig->buildDirectory();
|
params.projectBuildDirectory = buildConfig->buildDirectory();
|
||||||
params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
|
params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include "remotelinuxusedportsgatherer.h"
|
#include "remotelinuxusedportsgatherer.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <debugger/debuggertoolchaincombobox.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/devicesupport/devicemanagermodel.h>
|
#include <projectexplorer/devicesupport/devicemanagermodel.h>
|
||||||
@@ -73,7 +74,7 @@ using namespace ProjectExplorer;
|
|||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
const char LastSysroot[] = "RemoteLinux/LastSysroot";
|
const char LastProfile[] = "RemoteLinux/LastProfile";
|
||||||
const char LastDevice[] = "RemoteLinux/LastDevice";
|
const char LastDevice[] = "RemoteLinux/LastDevice";
|
||||||
const char LastProcessName[] = "RemoteLinux/LastProcessName";
|
const char LastProcessName[] = "RemoteLinux/LastProcessName";
|
||||||
//const char LastLocalExecutable[] = "RemoteLinux/LastLocalExecutable";
|
//const char LastLocalExecutable[] = "RemoteLinux/LastLocalExecutable";
|
||||||
@@ -104,7 +105,7 @@ public:
|
|||||||
QPushButton *attachProcessButton;
|
QPushButton *attachProcessButton;
|
||||||
QTextBrowser *textBrowser;
|
QTextBrowser *textBrowser;
|
||||||
QPushButton *closeButton;
|
QPushButton *closeButton;
|
||||||
PathChooser *sysrootPathChooser;
|
Debugger::ProfileChooser *profileChooser;
|
||||||
|
|
||||||
RemoteLinuxUsedPortsGatherer gatherer;
|
RemoteLinuxUsedPortsGatherer gatherer;
|
||||||
SshRemoteProcessRunner runner;
|
SshRemoteProcessRunner runner;
|
||||||
@@ -120,10 +121,11 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q
|
|||||||
|
|
||||||
deviceComboBox = new QComboBox(q);
|
deviceComboBox = new QComboBox(q);
|
||||||
|
|
||||||
sysrootPathChooser = new PathChooser(q);
|
profileChooser = new Debugger::ProfileChooser(q);
|
||||||
sysrootPathChooser->setExpectedKind(PathChooser::Directory);
|
// sysrootPathChooser = new PathChooser(q);
|
||||||
sysrootPathChooser->setPromptDialogTitle(StartGdbServerDialog::tr("Select Sysroot"));
|
// sysrootPathChooser->setExpectedKind(PathChooser::Directory);
|
||||||
sysrootPathChooser->setPath(settings->value(LastSysroot).toString());
|
// sysrootPathChooser->setPromptDialogTitle(StartGdbServerDialog::tr("Select Sysroot"));
|
||||||
|
// sysrootPathChooser->setPath(settings->value(LastSysroot).toString());
|
||||||
|
|
||||||
//executablePathChooser = new PathChooser(q);
|
//executablePathChooser = new PathChooser(q);
|
||||||
//executablePathChooser->setExpectedKind(PathChooser::File);
|
//executablePathChooser->setExpectedKind(PathChooser::File);
|
||||||
@@ -153,7 +155,7 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q
|
|||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
formLayout->addRow(StartGdbServerDialog::tr("Device:"), deviceComboBox);
|
formLayout->addRow(StartGdbServerDialog::tr("Device:"), deviceComboBox);
|
||||||
formLayout->addRow(StartGdbServerDialog::tr("Sysroot:"), sysrootPathChooser);
|
formLayout->addRow(StartGdbServerDialog::tr("Profile:"), profileChooser);
|
||||||
formLayout->addRow(StartGdbServerDialog::tr("&Filter entries:"), processFilterLineEdit);
|
formLayout->addRow(StartGdbServerDialog::tr("&Filter entries:"), processFilterLineEdit);
|
||||||
|
|
||||||
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
|
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
|
||||||
@@ -197,7 +199,7 @@ StartGdbServerDialog::StartGdbServerDialog(QWidget *parent) :
|
|||||||
connect(d->tableView->selectionModel(),
|
connect(d->tableView->selectionModel(),
|
||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||||
SLOT(updateButtons()));
|
SLOT(updateButtons()));
|
||||||
connect(d->sysrootPathChooser, SIGNAL(changed(QString)),
|
connect(d->profileChooser, SIGNAL(activated(int)),
|
||||||
SLOT(updateButtons()));
|
SLOT(updateButtons()));
|
||||||
//connect(d->updateListButton, SIGNAL(clicked()),
|
//connect(d->updateListButton, SIGNAL(clicked()),
|
||||||
// SLOT(updateProcessList()));
|
// SLOT(updateProcessList()));
|
||||||
@@ -281,7 +283,7 @@ void StartGdbServerDialog::attachToProcess()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->settings->setValue(LastSysroot, d->sysrootPathChooser->path());
|
d->settings->setValue(LastProfile, d->profileChooser->currentProfileId().toString());
|
||||||
d->settings->setValue(LastDevice, d->deviceComboBox->currentIndex());
|
d->settings->setValue(LastDevice, d->deviceComboBox->currentIndex());
|
||||||
d->settings->setValue(LastProcessName, d->processFilterLineEdit->text());
|
d->settings->setValue(LastProcessName, d->processFilterLineEdit->text());
|
||||||
|
|
||||||
@@ -380,7 +382,7 @@ void StartGdbServerDialog::reportOpenPort(int port)
|
|||||||
if (ob) {
|
if (ob) {
|
||||||
QMetaObject::invokeMethod(ob, member, Qt::QueuedConnection,
|
QMetaObject::invokeMethod(ob, member, Qt::QueuedConnection,
|
||||||
Q_ARG(QString, channel),
|
Q_ARG(QString, channel),
|
||||||
Q_ARG(QString, d->sysrootPathChooser->path()),
|
Q_ARG(QString, d->profileChooser->currentProfileId().toString()),
|
||||||
Q_ARG(QString, d->remoteCommandLine),
|
Q_ARG(QString, d->remoteCommandLine),
|
||||||
Q_ARG(QString, d->remoteExecutable));
|
Q_ARG(QString, d->remoteExecutable));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user