add continue until call/syscall to toolbar

This commit is contained in:
mandlebro 2018-06-14 00:02:16 +01:00 committed by xarkes
parent b1fa37a999
commit ffb3903311
7 changed files with 60 additions and 7 deletions

View File

@ -786,6 +786,22 @@ void CutterCore::continueUntilDebug(QString offset)
emit registersChanged();
}
void CutterCore::continueUntilCall()
{
cmd("dcc");
QString programCounterValue = cmd("dr?`drn pc`").trimmed();
seek(programCounterValue);
emit registersChanged();
}
void CutterCore::continueUntilSyscall()
{
cmd("dcs");
QString programCounterValue = cmd("dr?`drn pc`").trimmed();
seek(programCounterValue);
emit registersChanged();
}
void CutterCore::stepDebug()
{
cmd("ds");

View File

@ -471,6 +471,8 @@ public:
void startDebug();
void stopDebug();
void continueDebug();
void continueUntilCall();
void continueUntilSyscall();
void continueUntilDebug(QString offset);
void stepDebug();
void stepOverDebug();

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
<path d="M0 0v6l4-3-4-3z" transform="translate(0 1)" fill="#aaacaf"/>
<text x="4" y="4" font-family="Helvetica, Arial, sans-serif" font-size="5" stroke-width="1" stroke="#aaacaf" fill="#aaacaf" >C</text>
</svg>

After

Width:  |  Height:  |  Size: 295 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
<path d="M0 0v6l4-3-4-3z" transform="translate(0 1)" fill="#aaacaf"/>
<text x="4" y="4" font-family="Helvetica, Arial, sans-serif" font-size="5" stroke-width="1" stroke="#aaacaf" fill="#aaacaf" >S</text>
</svg>

After

Width:  |  Height:  |  Size: 295 B

View File

@ -23,6 +23,8 @@
<file>img/icons/media-stop_light.svg</file>
<file>img/icons/media-skip-forward_light.svg</file>
<file>img/icons/continue_until_main.svg</file>
<file>img/icons/continue_until_call.svg</file>
<file>img/icons/continue_until_syscall.svg</file>
<file>img/icons/step_light.svg</file>
<file>img/icons/step_over_light.svg</file>
<file>img/icons/cloud.svg</file>

View File

@ -985,11 +985,17 @@ QToolButton[popupMode="2"] {
border: 1px #76797C;
}
QToolButton:hover,
QToolButton::menu-button:hover {
QToolButton:hover {
background-color: transparent;
border: 1px solid #3daee9;
}
QToolButton::menu-button:hover {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
width: 16px;
background-color: transparent;
border: 1px solid #3daee9;
padding: 5px;
}
QToolButton:checked,
@ -997,7 +1003,6 @@ QToolButton:pressed,
QToolButton::menu-button:pressed {
background-color: #3daee9;
border: 1px solid #3daee9;
padding: 5px;
}

View File

@ -3,6 +3,8 @@
#include <QAction>
#include <QPainter>
#include <QToolButton>
#include <QMenu>
DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
QToolBar(parent),
@ -12,20 +14,36 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
QIcon startIcon = QIcon(":/img/icons/play_light.svg");
QIcon stopIcon = QIcon(":/img/icons/media-stop_light.svg");
QIcon continueIcon = QIcon(":/img/icons/media-skip-forward_light.svg");
QIcon continueUntilIcon = QIcon(":/img/icons/continue_until_main.svg");
QIcon continueUntilMainIcon = QIcon(":/img/icons/continue_until_main.svg");
QIcon continueUntilCallIcon = QIcon(":/img/icons/continue_until_call.svg");
QIcon continueUntilSyscallIcon = QIcon(":/img/icons/continue_until_syscall.svg");
QIcon stepIcon = QIcon(":/img/icons/step_light.svg");
QIcon stepOverIcon = QIcon(":/img/icons/step_over_light.svg");
QAction *actionStart = new QAction(startIcon, tr("Start debug"), parent);
QAction *actionStop = new QAction(stopIcon, tr("Stop debug"), parent);
QAction *actionContinue = new QAction(continueIcon, tr("Continue"), parent);
QAction *actionContinueUntilMain = new QAction(continueUntilIcon, tr("Continue until main"), parent);
QAction *actionContinueUntilMain = new QAction(continueUntilMainIcon, tr("Continue until main"), parent);
QAction *actionContinueUntilCall = new QAction(continueUntilCallIcon, tr("Continue until call"), parent);
QAction *actionContinueUntilSyscall = new QAction(continueUntilSyscallIcon, tr("Continue until syscall"), parent);
QAction *actionStep = new QAction(stepIcon, tr("Step"), parent);
QAction *actionStepOver = new QAction(stepOverIcon, tr("Step over"), parent);
QToolButton *continueUntilButton = new QToolButton;
continueUntilButton->setPopupMode(QToolButton::MenuButtonPopup);
connect(continueUntilButton, &QToolButton::triggered, continueUntilButton, &QToolButton::setDefaultAction);
QMenu *continueUntilMenu = new QMenu;
continueUntilMenu->addAction(actionContinueUntilMain);
continueUntilMenu->addAction(actionContinueUntilCall);
continueUntilMenu->addAction(actionContinueUntilSyscall);
continueUntilButton->setMenu(continueUntilMenu);
continueUntilButton->setDefaultAction(actionContinueUntilMain);
addAction(actionStart);
addAction(actionStop);
addAction(actionContinue);
addAction(actionContinueUntilMain);
addWidget(continueUntilButton);
addAction(actionStep);
addAction(actionStepOver);
@ -35,6 +53,8 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
connect(actionStepOver, &QAction::triggered, Core(), &CutterCore::stepOverDebug);
connect(actionContinue, &QAction::triggered, Core(), &CutterCore::continueDebug);
connect(actionContinueUntilMain, &QAction::triggered, this, &DebugToolbar::continueUntilMain);
connect(actionContinueUntilCall, &QAction::triggered, Core(), &CutterCore::continueUntilCall);
connect(actionContinueUntilSyscall, &QAction::triggered, Core(),&CutterCore::continueUntilSyscall);
}
void DebugToolbar::continueUntilMain()