Added debugger step back button. Functionality still TODO.

This commit is contained in:
mjbudd77 2021-08-19 18:15:27 -04:00
parent 525deb2a8f
commit 09117e5286
6 changed files with 45 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -18,6 +18,7 @@
<file>icons/debug-pause.png</file>
<file>icons/StepInto.png</file>
<file>icons/StepOver.png</file>
<file>icons/StepBack.png</file>
<file>icons/StepOut.png</file>
<file>icons/RunPpuFrame.png</file>
<file>icons/RunPpuHalfFrame.png</file>

View File

@ -76,6 +76,7 @@
#include "Qt/HexEditor.h"
#include "Qt/ConsoleDebugger.h"
#include "Qt/ConsoleUtilities.h"
#include "Qt/TraceLogger.h"
#include "Qt/ColorMenu.h"
// Where are these defined?
@ -588,6 +589,16 @@ QMenuBar *ConsoleDebugger::buildMenuBar(void)
debugMenu->addAction(act);
// Debug -> Step Back
stepBackMenuAct = act = new QAction(tr("Step &Back"), this);
act->setShortcut(QKeySequence( tr("F9") ) );
act->setStatusTip(tr("Step Back"));
act->setIcon( QIcon(":icons/StepBack.png") );
act->setEnabled(false);
connect( act, SIGNAL(triggered()), this, SLOT(debugStepBackCB(void)) );
debugMenu->addAction(act);
// Debug -> Run to Selected Line
act = new QAction(tr("Run to S&elected Line"), this);
act->setShortcut(QKeySequence( tr("F1") ) );
@ -831,6 +842,16 @@ QToolBar *ConsoleDebugger::buildToolBar(void)
toolBar->addAction(act);
// Debug -> Step Back
stepBackToolAct = act = new QAction(tr("Step &Back (F9)"), this);
//act->setShortcut(QKeySequence( tr("F9") ) );
act->setStatusTip(tr("Step Back"));
act->setIcon( QIcon(":icons/StepBack.png") );
act->setEnabled(false);
connect( act, SIGNAL(triggered()), this, SLOT(debugStepBackCB(void)) );
toolBar->addAction(act);
toolBar->addSeparator();
// Debug -> Run Line
@ -2725,6 +2746,14 @@ void ConsoleDebugger::debugStepOverCB(void)
}
}
//----------------------------------------------------------------------------
void ConsoleDebugger::debugStepBackCB(void)
{
if (FCEUI_EmulationPaused())
{
}
}
//----------------------------------------------------------------------------
void ConsoleDebugger::debugRunToCursorCB(void)
{
asmView->setBreakpointAtSelectedLine();
@ -4068,6 +4097,9 @@ void ConsoleDebugger::updatePeriodic(void)
dbgPauseAct[1]->setEnabled(true);
}
stepBackMenuAct->setEnabled( FCEUD_TraceLoggerRunning() );
stepBackToolAct->setEnabled( FCEUD_TraceLoggerRunning() );
if ( waitingAtBp && (lastBpIdx == BREAK_TYPE_CYCLES_EXCEED) )
{
cpuCyclesLbl1->setStyleSheet("background-color: blue; color: white;");

View File

@ -501,6 +501,8 @@ class ConsoleDebugger : public QDialog
QAction *brkOnCycleExcAct;
QAction *brkOnInstrExcAct;
QAction *stepBackMenuAct;
QAction *stepBackToolAct;
DebuggerTabWidget *tabView[2][4];
QWidget *asmViewContainerWidget;
@ -561,6 +563,7 @@ class ConsoleDebugger : public QDialog
void debugStepIntoCB(void);
void debugStepOutCB(void);
void debugStepOverCB(void);
void debugStepBackCB(void);
void debugRunToCursorCB(void);
void debugRunLineCB(void);
void debugRunLine128CB(void);

View File

@ -390,7 +390,7 @@ TraceLoggerDialog_t::~TraceLoggerDialog_t(void)
{
updateTimer->stop();
logging = 0;
//logging = 0;
msleep(1);
diskThread->requestInterruption();
diskThread->quit();
@ -1191,6 +1191,11 @@ static void pushMsgToLogBuffer(const char *msg)
pushToLogBuffer(rec);
}
//----------------------------------------------------
int FCEUD_TraceLoggerRunning(void)
{
return logging;
}
//----------------------------------------------------
//todo: really speed this up
void FCEUD_TraceInstruction(uint8 *opcode, int size)
{

View File

@ -14,6 +14,7 @@
#include <QLabel>
#include <QFrame>
#include <QTimer>
#include <QThread>
#include <QGroupBox>
#include <QScrollBar>
#include <QCloseEvent>
@ -224,3 +225,5 @@ private slots:
int initTraceLogBuffer(int maxRecs);
void openTraceLoggerWindow(QWidget *parent);
int FCEUD_TraceLoggerRunning(void);