aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/mainwindow.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-06 23:40:34 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-06 23:40:34 +0100
commit8d0f4806a7ad55710cb190e5a5c9388bd00c50a8 (patch)
tree16d5ac856513f44c4b1ecbccdebee151772f64e2 /qtmips_gui/mainwindow.cpp
parent1536045c0d28113892abc9d1023ce395a0e82e94 (diff)
downloadqtmips-8d0f4806a7ad55710cb190e5a5c9388bd00c50a8.tar.gz
qtmips-8d0f4806a7ad55710cb190e5a5c9388bd00c50a8.tar.bz2
qtmips-8d0f4806a7ad55710cb190e5a5c9388bd00c50a8.zip
Enable configuration of syscalls emulation and stop on exception.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/mainwindow.cpp')
-rw-r--r--qtmips_gui/mainwindow.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 3cefe94..d6d0b35 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -153,13 +153,21 @@ void MainWindow::create_core(const machine::MachineConfig &config) {
set_speed(); // Update machine speed to current settings
-#if 1
- osemu::OsSyscallExceptionHandler *osemu_handler = new osemu::OsSyscallExceptionHandler;
- machine->register_exception_handler(machine::EXCAUSE_SYSCALL, osemu_handler);
- connect(osemu_handler, SIGNAL(char_written(int,uint)), terminal, SLOT(tx_byte(int,uint)));
- connect(osemu_handler, SIGNAL(rx_byte_pool(int,uint&,bool&)),
+ if (config.osemu_enable()) {
+ osemu::OsSyscallExceptionHandler *osemu_handler =
+ new osemu::OsSyscallExceptionHandler(config.osemu_known_syscall_stop(),
+ config.osemu_unknown_syscall_stop());
+ machine->register_exception_handler(machine::EXCAUSE_SYSCALL, osemu_handler);
+ connect(osemu_handler, SIGNAL(char_written(int,uint)), terminal, SLOT(tx_byte(int,uint)));
+ connect(osemu_handler, SIGNAL(rx_byte_pool(int,uint&,bool&)),
terminal, SLOT(rx_byte_pool(int,uint&,bool&)));
-#endif
+ machine->set_step_over_exception(machine::EXCAUSE_SYSCALL, true);
+ machine->set_stop_on_exception(machine::EXCAUSE_SYSCALL, false);
+ } else {
+ machine->set_step_over_exception(machine::EXCAUSE_SYSCALL, false);
+ machine->set_stop_on_exception(machine::EXCAUSE_SYSCALL,
+ config.osemu_exception_stop());
+ }
// Connect machine signals and slots
connect(ui->actionRun, SIGNAL(triggered(bool)), machine, SLOT(play()));