mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
Adds step out funcionality (#598)
* Added step out functionality to toolbar and its shortcut * Remove step out button when emulating
This commit is contained in:
parent
be4144babe
commit
08245a8694
@ -1028,6 +1028,16 @@ void CutterCore::stepOverDebug()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CutterCore::stepOutDebug()
|
||||||
|
{
|
||||||
|
if (currentlyDebugging) {
|
||||||
|
cmd("dsf");
|
||||||
|
QString programCounterValue = cmd("dr?`drn PC`").trimmed();
|
||||||
|
seek(programCounterValue);
|
||||||
|
emit registersChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QStringList CutterCore::getDebugPlugins()
|
QStringList CutterCore::getDebugPlugins()
|
||||||
{
|
{
|
||||||
QStringList plugins;
|
QStringList plugins;
|
||||||
|
@ -514,6 +514,7 @@ public:
|
|||||||
void continueUntilDebug(QString offset);
|
void continueUntilDebug(QString offset);
|
||||||
void stepDebug();
|
void stepDebug();
|
||||||
void stepOverDebug();
|
void stepOverDebug();
|
||||||
|
void stepOutDebug();
|
||||||
void toggleBreakpoint(RVA addr);
|
void toggleBreakpoint(RVA addr);
|
||||||
void toggleBreakpoint(QString addr);
|
void toggleBreakpoint(QString addr);
|
||||||
void delBreakpoint(RVA addr);
|
void delBreakpoint(RVA addr);
|
||||||
|
@ -138,6 +138,7 @@ void MainWindow::initUI()
|
|||||||
ui->menuDebug->addSeparator();
|
ui->menuDebug->addSeparator();
|
||||||
ui->menuDebug->addAction(debugToolbar->actionStep);
|
ui->menuDebug->addAction(debugToolbar->actionStep);
|
||||||
ui->menuDebug->addAction(debugToolbar->actionStepOver);
|
ui->menuDebug->addAction(debugToolbar->actionStepOver);
|
||||||
|
ui->menuDebug->addAction(debugToolbar->actionStepOut);
|
||||||
ui->menuDebug->addSeparator();
|
ui->menuDebug->addSeparator();
|
||||||
// ui->menuDebug->addAction(debugToolbar->actionContinue);
|
// ui->menuDebug->addAction(debugToolbar->actionContinue);
|
||||||
// ui->menuDebug->addAction(debugToolbar->actionContinueUntilCall);
|
// ui->menuDebug->addAction(debugToolbar->actionContinueUntilCall);
|
||||||
|
7
src/img/icons/step_out_light.svg
Normal file
7
src/img/icons/step_out_light.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||||
|
<svg style="enable-background:new 0 0 24 32" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="32px" width="24px" version="1.1" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 32">
|
||||||
|
<g fill="#aaacaf">
|
||||||
|
<rect width="24" height="4.6"/>
|
||||||
|
<polygon points="8 14 8 32 16 32 16 14 20 14 12 4.6 4 14"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 452 B |
@ -29,6 +29,7 @@
|
|||||||
<file>img/icons/continue_until_syscall.svg</file>
|
<file>img/icons/continue_until_syscall.svg</file>
|
||||||
<file>img/icons/step_light.svg</file>
|
<file>img/icons/step_light.svg</file>
|
||||||
<file>img/icons/step_over_light.svg</file>
|
<file>img/icons/step_over_light.svg</file>
|
||||||
|
<file>img/icons/step_out_light.svg</file>
|
||||||
<file>img/icons/cloud.svg</file>
|
<file>img/icons/cloud.svg</file>
|
||||||
<file>img/icons/down.svg</file>
|
<file>img/icons/down.svg</file>
|
||||||
<file>img/icons/down_white.svg</file>
|
<file>img/icons/down_white.svg</file>
|
||||||
|
@ -23,6 +23,7 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
|
|||||||
QIcon continueUntilSyscallIcon = QIcon(":/img/icons/continue_until_syscall.svg");
|
QIcon continueUntilSyscallIcon = QIcon(":/img/icons/continue_until_syscall.svg");
|
||||||
QIcon stepIcon = QIcon(":/img/icons/step_light.svg");
|
QIcon stepIcon = QIcon(":/img/icons/step_light.svg");
|
||||||
QIcon stepOverIcon = QIcon(":/img/icons/step_over_light.svg");
|
QIcon stepOverIcon = QIcon(":/img/icons/step_over_light.svg");
|
||||||
|
QIcon stepOutIcon = QIcon(":/img/icons/step_out_light.svg");
|
||||||
|
|
||||||
actionStart = new QAction(startDebugIcon, tr("Start debug"), parent);
|
actionStart = new QAction(startDebugIcon, tr("Start debug"), parent);
|
||||||
actionStart->setShortcut(QKeySequence(Qt::Key_F9));
|
actionStart->setShortcut(QKeySequence(Qt::Key_F9));
|
||||||
@ -39,6 +40,8 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
|
|||||||
actionStep->setShortcut(QKeySequence(Qt::Key_F7));
|
actionStep->setShortcut(QKeySequence(Qt::Key_F7));
|
||||||
actionStepOver = new QAction(stepOverIcon, tr("Step over"), parent);
|
actionStepOver = new QAction(stepOverIcon, tr("Step over"), parent);
|
||||||
actionStepOver->setShortcut(QKeySequence(Qt::Key_F8));
|
actionStepOver->setShortcut(QKeySequence(Qt::Key_F8));
|
||||||
|
actionStepOut = new QAction(stepOutIcon, tr("Step out"), parent);
|
||||||
|
actionStepOut->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F8));
|
||||||
|
|
||||||
QToolButton *startButton = new QToolButton;
|
QToolButton *startButton = new QToolButton;
|
||||||
startButton->setPopupMode(QToolButton::MenuButtonPopup);
|
startButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
@ -68,6 +71,7 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
|
|||||||
addWidget(continueUntilButton);
|
addWidget(continueUntilButton);
|
||||||
addAction(actionStep);
|
addAction(actionStep);
|
||||||
addAction(actionStepOver);
|
addAction(actionStepOver);
|
||||||
|
addAction(actionStepOut);
|
||||||
|
|
||||||
connect(actionStop, &QAction::triggered, Core(), &CutterCore::stopDebug);
|
connect(actionStop, &QAction::triggered, Core(), &CutterCore::stopDebug);
|
||||||
connect(actionStop, &QAction::triggered, [ = ]() {
|
connect(actionStop, &QAction::triggered, [ = ]() {
|
||||||
@ -76,6 +80,7 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
|
|||||||
actionStartEmul->setVisible(true);
|
actionStartEmul->setVisible(true);
|
||||||
actionAttach->setVisible(true);
|
actionAttach->setVisible(true);
|
||||||
actionContinueUntilMain->setVisible(true);
|
actionContinueUntilMain->setVisible(true);
|
||||||
|
actionStepOut->setVisible(true);
|
||||||
this->colorToolbar(false);
|
this->colorToolbar(false);
|
||||||
});
|
});
|
||||||
connect(actionStep, &QAction::triggered, Core(), &CutterCore::stepDebug);
|
connect(actionStep, &QAction::triggered, Core(), &CutterCore::stepDebug);
|
||||||
@ -100,10 +105,12 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
|
|||||||
actionStart->setVisible(false);
|
actionStart->setVisible(false);
|
||||||
actionAttach->setVisible(false);
|
actionAttach->setVisible(false);
|
||||||
actionContinueUntilMain->setVisible(false);
|
actionContinueUntilMain->setVisible(false);
|
||||||
|
actionStepOut->setVisible(false);
|
||||||
continueUntilButton->setDefaultAction(actionContinueUntilSyscall);
|
continueUntilButton->setDefaultAction(actionContinueUntilSyscall);
|
||||||
this->colorToolbar(true);
|
this->colorToolbar(true);
|
||||||
});
|
});
|
||||||
connect(actionStepOver, &QAction::triggered, Core(), &CutterCore::stepOverDebug);
|
connect(actionStepOver, &QAction::triggered, Core(), &CutterCore::stepOverDebug);
|
||||||
|
connect(actionStepOut, &QAction::triggered, Core(), &CutterCore::stepOutDebug);
|
||||||
connect(actionContinue, &QAction::triggered, Core(), &CutterCore::continueDebug);
|
connect(actionContinue, &QAction::triggered, Core(), &CutterCore::continueDebug);
|
||||||
connect(actionContinueUntilMain, &QAction::triggered, this, &DebugToolbar::continueUntilMain);
|
connect(actionContinueUntilMain, &QAction::triggered, this, &DebugToolbar::continueUntilMain);
|
||||||
connect(actionContinueUntilCall, &QAction::triggered, Core(), &CutterCore::continueUntilCall);
|
connect(actionContinueUntilCall, &QAction::triggered, Core(), &CutterCore::continueUntilCall);
|
||||||
|
@ -20,6 +20,7 @@ public:
|
|||||||
QAction *actionContinueUntilSyscall;
|
QAction *actionContinueUntilSyscall;
|
||||||
QAction *actionStep;
|
QAction *actionStep;
|
||||||
QAction *actionStepOver;
|
QAction *actionStepOver;
|
||||||
|
QAction *actionStepOut;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MainWindow *main;
|
MainWindow *main;
|
||||||
|
Loading…
Reference in New Issue
Block a user