forked from qt-creator/qt-creator
Debugger: More modernization
New connects, some auto. Change-Id: I768637aae9cbb0a62e9082e56141f212022d8220 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -46,15 +46,13 @@ public:
|
|||||||
|
|
||||||
static void editBreakpoint(Breakpoint bp, QWidget *parent);
|
static void editBreakpoint(Breakpoint bp, QWidget *parent);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void showAddressColumn(bool on);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void rowActivated(const QModelIndex &index);
|
void rowActivated(const QModelIndex &index);
|
||||||
void contextMenuEvent(QContextMenuEvent *ev);
|
void contextMenuEvent(QContextMenuEvent *ev);
|
||||||
void keyPressEvent(QKeyEvent *ev);
|
void keyPressEvent(QKeyEvent *ev);
|
||||||
void mouseDoubleClickEvent(QMouseEvent *ev);
|
void mouseDoubleClickEvent(QMouseEvent *ev);
|
||||||
|
|
||||||
|
void showAddressColumn(bool on);
|
||||||
void deleteBreakpoints(const Breakpoints &bps);
|
void deleteBreakpoints(const Breakpoints &bps);
|
||||||
void deleteAllBreakpoints();
|
void deleteAllBreakpoints();
|
||||||
void addBreakpoint();
|
void addBreakpoint();
|
||||||
|
@@ -469,7 +469,11 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
|||||||
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||||
debugToolBarLayout->addWidget(d->m_viewButton);
|
debugToolBarLayout->addWidget(d->m_viewButton);
|
||||||
|
|
||||||
connect(d->m_viewButton, &QAbstractButton::clicked, this, &DebuggerMainWindow::showViewsMenu);
|
connect(d->m_viewButton, &QAbstractButton::clicked, [this] {
|
||||||
|
QMenu menu;
|
||||||
|
addDockActionsToMenu(&menu);
|
||||||
|
menu.exec(d->m_viewButton->mapToGlobal(QPoint()));
|
||||||
|
});
|
||||||
|
|
||||||
auto dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
auto dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
||||||
dock->setObjectName(QLatin1String("Debugger Toolbar"));
|
dock->setObjectName(QLatin1String("Debugger Toolbar"));
|
||||||
@@ -533,13 +537,6 @@ void DebuggerMainWindow::writeSettings() const
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerMainWindow::showViewsMenu()
|
|
||||||
{
|
|
||||||
QMenu menu;
|
|
||||||
addDockActionsToMenu(&menu);
|
|
||||||
menu.exec(d->m_viewButton->mapToGlobal(QPoint()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerMainWindow::readSettings()
|
void DebuggerMainWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
|
@@ -86,9 +86,6 @@ public:
|
|||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings() const;
|
void writeSettings() const;
|
||||||
|
|
||||||
private slots:
|
|
||||||
void showViewsMenu();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Internal::DebuggerMainWindowPrivate;
|
friend class Internal::DebuggerMainWindowPrivate;
|
||||||
Internal::DebuggerMainWindowPrivate *d;
|
Internal::DebuggerMainWindowPrivate *d;
|
||||||
|
@@ -50,12 +50,12 @@
|
|||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
static const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
||||||
static const char USE_CPP_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseCppDebuggerAuto";
|
const char USE_CPP_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseCppDebuggerAuto";
|
||||||
static const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
||||||
static const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
||||||
static const char QML_DEBUG_SERVER_PORT_KEY[] = "RunConfiguration.QmlDebugServerPort";
|
const char QML_DEBUG_SERVER_PORT_KEY[] = "RunConfiguration.QmlDebugServerPort";
|
||||||
static const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class DebuggerRunConfigWidget : public RunConfigWidget
|
class DebuggerRunConfigWidget : public RunConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::RunConfigWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DebuggerRunConfigWidget(DebuggerRunConfigurationAspect *aspect);
|
explicit DebuggerRunConfigWidget(DebuggerRunConfigurationAspect *aspect);
|
||||||
@@ -79,7 +79,6 @@ public:
|
|||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void useCppDebuggerClicked(bool on);
|
void useCppDebuggerClicked(bool on);
|
||||||
void useQmlDebuggerToggled(bool on);
|
void useQmlDebuggerToggled(bool on);
|
||||||
void useQmlDebuggerClicked(bool on);
|
void useQmlDebuggerClicked(bool on);
|
||||||
@@ -120,8 +119,8 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
|
|||||||
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
||||||
m_useMultiProcess->setVisible(env.toInt());
|
m_useMultiProcess->setVisible(env.toInt());
|
||||||
|
|
||||||
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
connect(m_qmlDebuggerInfoLabel, &QLabel::linkActivated,
|
||||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
[](const QString &link) { Core::HelpManager::handleHelpRequest(link); });
|
||||||
connect(m_useQmlDebugger, &QAbstractButton::toggled,
|
connect(m_useQmlDebugger, &QAbstractButton::toggled,
|
||||||
this, &DebuggerRunConfigWidget::useQmlDebuggerToggled);
|
this, &DebuggerRunConfigWidget::useQmlDebuggerToggled);
|
||||||
connect(m_useQmlDebugger, &QAbstractButton::clicked,
|
connect(m_useQmlDebugger, &QAbstractButton::clicked,
|
||||||
@@ -343,6 +342,3 @@ RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
|
||||||
#include "debuggerrunconfigurationaspect.moc"
|
|
||||||
|
@@ -79,10 +79,8 @@ signals:
|
|||||||
void aboutToNotifyInferiorSetupOk();
|
void aboutToNotifyInferiorSetupOk();
|
||||||
void stateChanged(Debugger::DebuggerState state);
|
void stateChanged(Debugger::DebuggerState state);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void handleFinished();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void handleFinished();
|
||||||
friend class DebuggerRunControlFactory;
|
friend class DebuggerRunControlFactory;
|
||||||
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
Internal::DebuggerEngine *engine);
|
Internal::DebuggerEngine *engine);
|
||||||
|
@@ -38,12 +38,6 @@
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// CoreGdbAdapter
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class GdbCoreEngine : public GdbEngine
|
class GdbCoreEngine : public GdbEngine
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -74,7 +68,6 @@ private:
|
|||||||
QString coreFileName() const;
|
QString coreFileName() const;
|
||||||
QString coreName() const;
|
QString coreName() const;
|
||||||
|
|
||||||
private slots:
|
|
||||||
void continueSetupEngine();
|
void continueSetupEngine();
|
||||||
void writeCoreChunk();
|
void writeCoreChunk();
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class SelectRemoteFileDialog : public QDialog
|
class SelectRemoteFileDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::SelectRemoteFileDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SelectRemoteFileDialog(QWidget *parent);
|
explicit SelectRemoteFileDialog(QWidget *parent);
|
||||||
@@ -289,12 +289,12 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
|||||||
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
|
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
|
||||||
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
|
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
|
||||||
|
|
||||||
QHBoxLayout *coreLayout = new QHBoxLayout;
|
auto coreLayout = new QHBoxLayout;
|
||||||
coreLayout->addWidget(d->localCoreFileName);
|
coreLayout->addWidget(d->localCoreFileName);
|
||||||
coreLayout->addWidget(d->remoteCoreFileName);
|
coreLayout->addWidget(d->remoteCoreFileName);
|
||||||
coreLayout->addWidget(d->selectRemoteCoreButton);
|
coreLayout->addWidget(d->selectRemoteCoreButton);
|
||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout;
|
auto formLayout = new QFormLayout;
|
||||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
formLayout->setHorizontalSpacing(6);
|
formLayout->setHorizontalSpacing(6);
|
||||||
formLayout->setVerticalSpacing(6);
|
formLayout->setVerticalSpacing(6);
|
||||||
@@ -304,13 +304,13 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
|||||||
formLayout->addRow(tr("&Executable:"), d->localExecFileName);
|
formLayout->addRow(tr("&Executable:"), d->localExecFileName);
|
||||||
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
||||||
|
|
||||||
QFrame *line = new QFrame(this);
|
auto line = new QFrame(this);
|
||||||
line->setFrameShape(QFrame::HLine);
|
line->setFrameShape(QFrame::HLine);
|
||||||
line->setFrameShadow(QFrame::Sunken);
|
line->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
formLayout->addRow(d->buttonBox);
|
formLayout->addRow(d->buttonBox);
|
||||||
|
|
||||||
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
|
auto vboxLayout = new QVBoxLayout(this);
|
||||||
vboxLayout->addLayout(formLayout);
|
vboxLayout->addLayout(formLayout);
|
||||||
vboxLayout->addStretch();
|
vboxLayout->addStretch();
|
||||||
vboxLayout->addWidget(line);
|
vboxLayout->addWidget(line);
|
||||||
@@ -474,5 +474,3 @@ void AttachCoreDialog::setOverrideStartScript(const QString &scriptName)
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
#include "loadcoredialog.moc"
|
|
||||||
|
@@ -68,12 +68,11 @@ public:
|
|||||||
void setKitId(Core::Id id);
|
void setKitId(Core::Id id);
|
||||||
void setForceLocalCoreFile(bool on);
|
void setForceLocalCoreFile(bool on);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void changed();
|
void changed();
|
||||||
void coreFileChanged(const QString &core);
|
void coreFileChanged(const QString &core);
|
||||||
void selectRemoteCoreFile();
|
void selectRemoteCoreFile();
|
||||||
|
|
||||||
private:
|
|
||||||
AttachCoreDialogPrivate *d;
|
AttachCoreDialogPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -35,19 +35,16 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
||||||
const int LOCAL_WIDGET_INDEX = 0;
|
|
||||||
const int INSPECTOR_WIDGET_INDEX = 1;
|
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
|
enum { LocalsIndex = 0, InspectorIndex = 1 };
|
||||||
QWidget *locals, QWidget *inspector, QWidget *returnWidget,
|
|
||||||
QWidget *watchers, QWidget *parent)
|
LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
|
||||||
: QWidget(parent),
|
QWidget *inspector, QWidget *returnWidget, QWidget *watchers)
|
||||||
m_showLocals(false)
|
: m_showLocals(false)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
layout->setMargin(0);
|
layout->setMargin(0);
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
|
|
||||||
@@ -71,7 +68,9 @@ LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
|
|||||||
// when debugger engine changes states.
|
// when debugger engine changes states.
|
||||||
m_timer.setSingleShot(true);
|
m_timer.setSingleShot(true);
|
||||||
m_timer.setInterval(500); // TODO: remove the magic number!
|
m_timer.setInterval(500); // TODO: remove the magic number!
|
||||||
connect(&m_timer, SIGNAL(timeout()), SLOT(showLocals()));
|
connect(&m_timer, &QTimer::timeout, [this] {
|
||||||
|
m_localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
||||||
@@ -80,16 +79,5 @@ void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
|||||||
m_timer.start();
|
m_timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalsAndExpressionsWindow::showLocals()
|
|
||||||
{
|
|
||||||
m_localsAndInspector->setCurrentIndex(m_showLocals ? LOCAL_WIDGET_INDEX
|
|
||||||
: INSPECTOR_WIDGET_INDEX);
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget *LocalsAndExpressionsWindow::inspectorWidget() const
|
|
||||||
{
|
|
||||||
return m_localsAndInspector->widget(INSPECTOR_WIDGET_INDEX);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -45,16 +45,12 @@ namespace Internal {
|
|||||||
class LocalsAndExpressionsWindow : public QWidget
|
class LocalsAndExpressionsWindow : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LocalsAndExpressionsWindow(
|
LocalsAndExpressionsWindow(QWidget *locals, QWidget *inspector,
|
||||||
QWidget *locals, QWidget *inspector,
|
QWidget *returnWidget, QWidget *watchers);
|
||||||
QWidget *returnWidget, QWidget *watchers, QWidget *parent = 0);
|
|
||||||
|
|
||||||
void setShowLocals(bool showLocals);
|
void setShowLocals(bool showLocals);
|
||||||
QWidget *inspectorWidget() const;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void showLocals();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSplitter *m_splitter;
|
QSplitter *m_splitter;
|
||||||
|
@@ -43,10 +43,8 @@ class ModulesTreeView : public Utils::BaseTreeView
|
|||||||
public:
|
public:
|
||||||
ModulesTreeView();
|
ModulesTreeView();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void moduleActivated(const QModelIndex &index);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void moduleActivated(const QModelIndex &index);
|
||||||
void contextMenuEvent(QContextMenuEvent *ev);
|
void contextMenuEvent(QContextMenuEvent *ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user