Adding a clear button to the history

This commit is contained in:
AnonymusRaccoon
2020-02-28 11:30:08 +01:00
parent f2e59a3225
commit 3e2231482d
4 changed files with 48 additions and 33 deletions
+8 -2
View File
@@ -19,6 +19,7 @@ namespace ComSquare::Debugger
this->_ui.setupUi(this);
QMainWindow::connect(this->_ui.actionPause, &QAction::triggered, this, &CPUDebug::pause);
QMainWindow::connect(this->_ui.actionStep, &QAction::triggered, this, &CPUDebug::step);
QMainWindow::connect(this->_ui.clear, &QPushButton::released, this, &CPUDebug::clearHistory);
this->show();
this->_updateRegistersPanel();
}
@@ -35,8 +36,8 @@ namespace ComSquare::Debugger
return 0xFF;
return CPU::update();
} catch (InvalidOpcode &e) {
this->pause();
this->_ui.logger->append(e.what());
if (!this->_isPaused)
this->pause();
return 0xFF;
}
}
@@ -111,6 +112,11 @@ namespace ComSquare::Debugger
return str;
}
void CPUDebug::clearHistory()
{
this->_ui.logger->clear();
}
std::string CPUDebug::_getImmediateValue(uint24_t pc)
{
unsigned value = this->_bus->read(pc);