Explicitly state syscall function register upon syscall error
Shall hopefully clear up any confusion wrt. which register is expected
to be used for system calls.
ADD
src/syscall/ripes_syscall.cpp
+#include "ripes_syscall.h"
+
+#include "processorhandler.h"
+
+namespace Ripes {
+
+bool SyscallManager::execute(int id) {
+ if (m_syscalls.count(id) == 0) {
+ postToGUIThread([=] {
+ QMessageBox::warning(nullptr, "Error",
+ "Unknown system call in register '" +
+ ProcessorHandler::get()->currentISA()->regAlias(
+ ProcessorHandler::get()->currentISA()->syscallReg()) +
+ "': " + QString::number(id) +
+ "\nRefer to \"Help->System calls\" for a list of support system calls.");
+ });
+ return false;
+ } else {
+ const auto& syscall = m_syscalls.at(id);
+ SyscallStatusManager::setStatus("Handling system call: " + syscall->name() + " (" + QString::number(id) + ")");
+ syscall->execute();
+ SyscallStatusManager::clearStatus();
+ return true;
+ }
+}
+
+} // namespace Ripes

MODIFY
src/syscall/ripes_syscall.h
src/syscall/ripes_syscall.h
@@ -77,23 +77,7 @@ public:
* @brief execute
* Executes the syscall identified by id. Throws out of range exception if syscall @p id is unknown.
*/
- bool execute(int id) {
- if (m_syscalls.count(id) == 0) {
- postToGUIThread([=] {
- QMessageBox::warning(nullptr, "Error",
- "Unknown system call: " + QString::number(id) +
- "\nRefer to \"Help->System calls\" for a list of support system calls.");
- });
- return false;
- } else {
- const auto& syscall = m_syscalls.at(id);
- SyscallStatusManager::setStatus("Handling system call: " + syscall->name() + " (" + QString::number(id) +
- ")");
- syscall->execute();
- SyscallStatusManager::clearStatus();
- return true;
- }
- }
+ bool execute(int id);
const std::map<int, std::unique_ptr<Syscall>>& getSyscalls() const { return m_syscalls; }

MODIFY
src/syscall/syscallviewer.cpp
src/syscall/syscallviewer.cpp
@@ -30,7 +30,10 @@ SyscallViewer::SyscallViewer(QWidget* parent) : QDialog(parent), m_ui(new Ui::Sy
}
m_ui->syscallList->setSelectionBehavior(QAbstractItemView::SelectRows);
m_ui->syscallList->verticalHeader()->hide();
- m_ui->syscallList->setHorizontalHeaderLabels({"Call number", "Name"});
+ m_ui->syscallList->setHorizontalHeaderLabels(
+ {"Func. (" +
+ ProcessorHandler::get()->currentISA()->regAlias(ProcessorHandler::get()->currentISA()->syscallReg()) + ")",
+ "Name"});
m_ui->syscallList->horizontalHeader()->setStretchLastSection(true);
connect(m_ui->syscallList, &QTableWidget::currentItemChanged, this, &SyscallViewer::handleItemChanged);

Explicitly state syscall function register upon syscall error

Shall hopefully clear up any confusion wrt. which register is expected
to be used for system calls.