lldb: enable lldb through gui configure page

parent 7169bfff
......@@ -418,6 +418,10 @@ void addTcfOptionPages(QList<IOptionsPage*> *opts);
void addCdbOptionPages(QList<IOptionsPage*> *opts);
#endif
#ifdef WITH_LLDB
void addLldbOptionPages(QList<IOptionsPage*> *opts);
#endif
static SessionManager *sessionManager()
{
return ProjectExplorerPlugin::instance()->session();
......@@ -808,6 +812,10 @@ static bool parseArgument(QStringList::const_iterator &it,
*enabledEngines &= ~TcfEngineType;
return true;
}
if (option == _("-disable-lldb")) {
*enabledEngines &= ~LldbEngineType;
return true;
}
*errorMessage = DebuggerPlugin::tr("Invalid debugger option: %1").arg(option);
return false;
......@@ -1947,6 +1955,11 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
#ifdef Q_OS_WIN
Debugger::Cdb::addCdb2OptionPages(&engineOptionPages);
#endif
#ifdef WITH_LLDB
if (cmdLineEnabledEngines & LldbEngineType)
addLldbOptionPages(&engineOptionPages);
#endif
//if (cmdLineEnabledEngines & ScriptEngineType)
// addScriptOptionPages(&engineOptionPages);
//if (cmdLineEnabledEngines & TcfEngineType)
......
......@@ -460,8 +460,14 @@ static DebuggerEngineType engineForToolChain(int toolChainType)
case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC:
case ProjectExplorer::ToolChain_GCCE_GNUPOC:
case ProjectExplorer::ToolChain_GCC_MAEMO:
#ifdef WITH_LLDB
// lldb override
if (Core::ICore::instance()->settings()->value("LLDB/enabled").toBool())
return LldbEngineType;
#endif
return GdbEngineType;
case ProjectExplorer::ToolChain_MSVC:
case ProjectExplorer::ToolChain_WINCE:
return CdbEngineType;
......@@ -499,9 +505,6 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams
if (sp.processArgs.startsWith(__("@tcf@ ")))
engineType = GdbEngineType;
if (sp.processArgs.contains( _("@lldb@")))
engineType = LldbEngineType;
if (engineType == NoEngineType
&& sp.startMode != AttachToRemote
&& !sp.executable.isEmpty())
......
......@@ -14,4 +14,7 @@ RESOURCES +=
!isEmpty(WITH_LLDB) {
DEFINES += WITH_LLDB
HEADERS += $$PWD/lldboptionspage.h
SOURCES += $$PWD/lldboptionspage.cpp
FORMS += $$PWD/lldboptionspagewidget.ui
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "lldboptionspage.h"
#include "debuggerconstants.h"
#include <coreplugin/icore.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QUrl>
#include <QtCore/QTextStream>
#include <QtGui/QMessageBox>
#include <QtGui/QDesktopServices>
namespace Debugger {
namespace Internal {
LldbOptionsPageWidget::LldbOptionsPageWidget(QWidget *parent, QSettings *s_)
: QWidget(parent)
, s(s_)
{
m_ui.setupUi(this);
load();
}
void LldbOptionsPageWidget::save()
{
s->beginGroup(QLatin1String("LLDB"));
s->setValue(QLatin1String("enabled"), m_ui.enableLldb->isChecked ());
s->setValue(QLatin1String("gdbEmu"), m_ui.gdbEmu->isChecked ());
s->endGroup();
}
void LldbOptionsPageWidget::load()
{
s->beginGroup(QLatin1String("LLDB"));
m_ui.enableLldb->setChecked(s->value(QLatin1String("enabled"), false).toBool());
m_ui.gdbEmu->setChecked(s->value(QLatin1String("gdbEmu"), true).toBool());
s->endGroup();
}
// ---------- LldbOptionsPage
LldbOptionsPage::LldbOptionsPage()
{
// m_options->fromSettings(Core::ICore::instance()->settings());
}
LldbOptionsPage::~LldbOptionsPage()
{
}
QString LldbOptionsPage::settingsId()
{
return QLatin1String("F.Lldb");
}
QString LldbOptionsPage::displayName() const
{
return tr("LLDB");
}
QString LldbOptionsPage::category() const
{
return QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
}
QString LldbOptionsPage::displayCategory() const
{
return QCoreApplication::translate("Debugger", Debugger::Constants::DEBUGGER_SETTINGS_TR_CATEGORY);
}
QIcon LldbOptionsPage::categoryIcon() const
{
return QIcon(QLatin1String(Debugger::Constants::DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
}
QWidget *LldbOptionsPage::createPage(QWidget *parent)
{
m_widget = new LldbOptionsPageWidget(parent, Core::ICore::instance()->settings());
return m_widget;
}
void LldbOptionsPage::apply()
{
if (!m_widget)
return;
m_widget->save();
}
void LldbOptionsPage::finish()
{
}
bool LldbOptionsPage::matches(const QString &s) const
{
return QString(s.toLower()).contains("lldb");
}
void addLldbOptionPages(QList<Core::IOptionsPage *> *opts)
{
opts->push_back(new LldbOptionsPage);
}
} // namespace Internal
} // namespace Debugger
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef LLDBSETTINGSPAGE_H
#define LLDBSETTINGSPAGE_H
#include <coreplugin/dialogs/ioptionspage.h>
#include "ui_lldboptionspagewidget.h"
#include <QtGui/QWidget>
#include <QtCore/QPointer>
#include <QtCore/QSharedPointer>
#include <QtCore/QSettings>
namespace Debugger {
namespace Internal {
class LldbOptionsPageWidget : public QWidget
{
Q_OBJECT
public:
explicit LldbOptionsPageWidget(QWidget *parent, QSettings *s);
public slots:
void save();
void load();
private:
Ui::LldbOptionsPageWidget m_ui;
QSettings *s;
};
class LldbOptionsPage : public Core::IOptionsPage
{
Q_DISABLE_COPY(LldbOptionsPage)
Q_OBJECT
public:
explicit LldbOptionsPage();
virtual ~LldbOptionsPage();
// IOptionsPage
virtual QString id() const { return settingsId(); }
virtual QString displayName() const;
virtual QString category() const;
virtual QString displayCategory() const;
QIcon categoryIcon() const;
virtual QWidget *createPage(QWidget *parent);
virtual void apply();
virtual void finish();
virtual bool matches(const QString &) const;
static QString settingsId();
private:
QPointer<LldbOptionsPageWidget> m_widget;
};
} // namespace Internal
} // namespace Debugger
#endif // LLDBSETTINGSPAGE_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LldbOptionsPageWidget</class>
<widget class="QWidget" name="LldbOptionsPageWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>522</width>
<height>512</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout"/>
</item>
<item>
<widget class="QGroupBox" name="enableLldb">
<property name="title">
<string>Enable LLDB</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="gdbEmu">
<property name="text">
<string>Use Gdb python dumpers</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>203</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment