forked from qt-creator/qt-creator
Debugger: Add button to debug python dumpers
This searches the last 'bb' command and triggers a re-run with the 'pe' option added. Change-Id: Icbe251c9f8980f3bcd0ba10171ec39f0fb02c2f4 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -41,7 +41,9 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QSyntaxHighlighter>
|
#include <QSyntaxHighlighter>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <aggregation/aggregate.h>
|
#include <aggregation/aggregate.h>
|
||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
@@ -360,12 +362,18 @@ LogWindow::LogWindow(QWidget *parent)
|
|||||||
m_inputText->setSizePolicy(QSizePolicy::MinimumExpanding,
|
m_inputText->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||||
QSizePolicy::MinimumExpanding);
|
QSizePolicy::MinimumExpanding);
|
||||||
|
|
||||||
m_commandLabel = new QLabel(tr("Command:"), this);
|
|
||||||
m_commandEdit = new Utils::FancyLineEdit(this);
|
m_commandEdit = new Utils::FancyLineEdit(this);
|
||||||
m_commandEdit->setFrame(false);
|
m_commandEdit->setFrame(false);
|
||||||
m_commandEdit->setHistoryCompleter(QLatin1String("DebuggerInput"));
|
m_commandEdit->setHistoryCompleter(QLatin1String("DebuggerInput"));
|
||||||
|
|
||||||
|
QToolButton *repeatButton = new QToolButton(this);
|
||||||
|
repeatButton->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png")));
|
||||||
|
repeatButton->setIconSize(QSize(12, 12));
|
||||||
|
repeatButton->setToolTip(tr("Repeat last command for debug reasons"));
|
||||||
|
|
||||||
QHBoxLayout *commandBox = new QHBoxLayout;
|
QHBoxLayout *commandBox = new QHBoxLayout;
|
||||||
commandBox->addWidget(m_commandLabel);
|
commandBox->addWidget(repeatButton);
|
||||||
|
commandBox->addWidget(new QLabel(tr("Command:"), this));
|
||||||
commandBox->addWidget(m_commandEdit);
|
commandBox->addWidget(m_commandEdit);
|
||||||
commandBox->setMargin(2);
|
commandBox->setMargin(2);
|
||||||
commandBox->setSpacing(6);
|
commandBox->setSpacing(6);
|
||||||
@@ -407,6 +415,8 @@ LogWindow::LogWindow(QWidget *parent)
|
|||||||
SLOT(sendCommand()));
|
SLOT(sendCommand()));
|
||||||
connect(m_inputText, SIGNAL(executeLineRequested()),
|
connect(m_inputText, SIGNAL(executeLineRequested()),
|
||||||
SLOT(executeLine()));
|
SLOT(executeLine()));
|
||||||
|
connect(repeatButton, SIGNAL(clicked()),
|
||||||
|
SLOT(repeatLastCommand()));
|
||||||
|
|
||||||
connect(&m_outputTimer, SIGNAL(timeout()), SLOT(doOutput()));
|
connect(&m_outputTimer, SIGNAL(timeout()), SLOT(doOutput()));
|
||||||
|
|
||||||
@@ -420,6 +430,20 @@ void LogWindow::executeLine()
|
|||||||
CppLanguage);
|
CppLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogWindow::repeatLastCommand()
|
||||||
|
{
|
||||||
|
QTextCursor tc = m_inputText->textCursor();
|
||||||
|
QRegExp re = QRegExp(QLatin1String("^\\d+(bb options:)(.*)$"));
|
||||||
|
for (QTextBlock block = tc.block(); block.isValid(); block = block.previous()) {
|
||||||
|
QString line = block.text();
|
||||||
|
if (re.exactMatch(line)) {
|
||||||
|
QString cmd = re.cap(1) + QLatin1String("pe,") + re.cap(2);
|
||||||
|
debuggerCore()->executeDebuggerCommand(cmd, CppLanguage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LogWindow::sendCommand()
|
void LogWindow::sendCommand()
|
||||||
{
|
{
|
||||||
debuggerCore()->executeDebuggerCommand(m_commandEdit->text(), CppLanguage);
|
debuggerCore()->executeDebuggerCommand(m_commandEdit->text(), CppLanguage);
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public slots:
|
|||||||
void showOutput(int channel, const QString &output);
|
void showOutput(int channel, const QString &output);
|
||||||
void showInput(int channel, const QString &input);
|
void showInput(int channel, const QString &input);
|
||||||
void doOutput();
|
void doOutput();
|
||||||
|
void repeatLastCommand();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void showPage();
|
void showPage();
|
||||||
@@ -86,7 +87,6 @@ private:
|
|||||||
QTimer m_outputTimer;
|
QTimer m_outputTimer;
|
||||||
QString m_queuedOutput;
|
QString m_queuedOutput;
|
||||||
Utils::FancyLineEdit *m_commandEdit;
|
Utils::FancyLineEdit *m_commandEdit;
|
||||||
QLabel *m_commandLabel;
|
|
||||||
bool m_ignoreNextInputEcho;
|
bool m_ignoreNextInputEcho;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user