2010-01-04 11:36:55 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2009 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.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-04-17 09:03:32 +02:00
|
|
|
#include "gdboptionspage.h"
|
|
|
|
|
#include "debuggeractions.h"
|
|
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
#include <QtCore/QCoreApplication>
|
2009-11-24 15:05:02 +01:00
|
|
|
#include <QtCore/QTextStream>
|
2009-04-17 09:03:32 +02:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
GdbOptionsPage::GdbOptionsPage()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString GdbOptionsPage::settingsId()
|
|
|
|
|
{
|
2009-11-27 16:12:12 +01:00
|
|
|
return QLatin1String("M.Gdb");
|
2009-04-17 09:03:32 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
QString GdbOptionsPage::displayName() const
|
2009-04-17 09:03:32 +02:00
|
|
|
{
|
2009-11-27 16:12:12 +01:00
|
|
|
return tr("Gdb");
|
2009-04-17 09:03:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString GdbOptionsPage::category() const
|
|
|
|
|
{
|
|
|
|
|
return QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
QString GdbOptionsPage::displayCategory() const
|
2009-04-17 09:03:32 +02:00
|
|
|
{
|
2009-11-27 16:12:12 +01:00
|
|
|
return QCoreApplication::translate("Debugger", Debugger::Constants::DEBUGGER_SETTINGS_TR_CATEGORY);
|
2009-04-17 09:03:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *GdbOptionsPage::createPage(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
QWidget *w = new QWidget(parent);
|
|
|
|
|
m_ui.setupUi(w);
|
2009-10-05 11:06:05 +02:00
|
|
|
m_ui.gdbLocationChooser->setExpectedKind(Utils::PathChooser::Command);
|
2009-04-17 09:03:32 +02:00
|
|
|
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
|
2009-10-05 11:06:05 +02:00
|
|
|
m_ui.scriptFileChooser->setExpectedKind(Utils::PathChooser::File);
|
2009-04-17 09:03:32 +02:00
|
|
|
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
|
|
|
|
|
|
|
|
|
|
m_group.clear();
|
|
|
|
|
m_group.insert(theDebuggerAction(GdbLocation),
|
|
|
|
|
m_ui.gdbLocationChooser);
|
|
|
|
|
m_group.insert(theDebuggerAction(GdbScriptFile),
|
|
|
|
|
m_ui.scriptFileChooser);
|
|
|
|
|
m_group.insert(theDebuggerAction(GdbEnvironment),
|
|
|
|
|
m_ui.environmentEdit);
|
2010-01-29 21:33:57 +01:00
|
|
|
m_group.insert(theDebuggerAction(UsePreciseBreakpoints),
|
2009-12-09 11:13:20 +01:00
|
|
|
m_ui.checkBoxUsePreciseBreakpoints);
|
2010-01-29 21:33:57 +01:00
|
|
|
m_group.insert(theDebuggerAction(GdbWatchdogTimeout),
|
2009-12-09 15:23:49 +01:00
|
|
|
m_ui.spinBoxGdbWatchdogTimeout);
|
|
|
|
|
|
2009-04-17 09:03:32 +02:00
|
|
|
|
2009-10-23 17:32:11 +02:00
|
|
|
#if 1
|
|
|
|
|
m_ui.groupBoxPluginDebugging->hide();
|
|
|
|
|
#else // The related code (handleAqcuiredInferior()) is disabled as well.
|
2009-04-17 09:03:32 +02:00
|
|
|
m_group.insert(theDebuggerAction(AllPluginBreakpoints),
|
|
|
|
|
m_ui.radioButtonAllPluginBreakpoints);
|
|
|
|
|
m_group.insert(theDebuggerAction(SelectedPluginBreakpoints),
|
|
|
|
|
m_ui.radioButtonSelectedPluginBreakpoints);
|
|
|
|
|
m_group.insert(theDebuggerAction(NoPluginBreakpoints),
|
|
|
|
|
m_ui.radioButtonNoPluginBreakpoints);
|
|
|
|
|
m_group.insert(theDebuggerAction(SelectedPluginBreakpointsPattern),
|
|
|
|
|
m_ui.lineEditSelectedPluginBreakpointsPattern);
|
2009-10-23 17:32:11 +02:00
|
|
|
#endif
|
2009-04-17 09:03:32 +02:00
|
|
|
|
|
|
|
|
m_ui.lineEditSelectedPluginBreakpointsPattern->
|
|
|
|
|
setEnabled(theDebuggerAction(SelectedPluginBreakpoints)->value().toBool());
|
|
|
|
|
connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
|
|
|
|
|
m_ui.lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool)));
|
|
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
m_ui.environmentEdit->hide();
|
|
|
|
|
m_ui.labelEnvironment->hide();
|
|
|
|
|
|
2009-11-24 15:05:02 +01:00
|
|
|
if (m_searchKeywords.isEmpty()) {
|
|
|
|
|
// TODO: Add breakpoints, environment?
|
|
|
|
|
QTextStream(&m_searchKeywords) << ' ' << m_ui.labelGdbLocation->text()
|
|
|
|
|
<< ' ' << m_ui.labelEnvironment->text()
|
|
|
|
|
<< ' ' << m_ui.labelGdbStartupScript->text();
|
|
|
|
|
m_searchKeywords.remove(QLatin1Char('&'));
|
|
|
|
|
}
|
2009-04-17 09:03:32 +02:00
|
|
|
return w;
|
|
|
|
|
}
|
|
|
|
|
void GdbOptionsPage::apply()
|
|
|
|
|
{
|
|
|
|
|
m_group.apply(Core::ICore::instance()->settings());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GdbOptionsPage::finish()
|
|
|
|
|
{
|
|
|
|
|
m_group.finish();
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-24 15:05:02 +01:00
|
|
|
bool GdbOptionsPage::matches(const QString &s) const
|
|
|
|
|
{
|
|
|
|
|
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-17 09:03:32 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|