From fc3571602f19d86ca86c25dd204f8662782e62d6 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sat, 9 Mar 2019 20:37:54 +0100 Subject: Updated read and write, added open, close, ftruncate syscalls and fs_root option. When operating system emulation root directory (fs_root) are selected then open() syscall opens real host system files in this limited subtree. When fs_root is not set then console is mapped to all read, write, open and close calls. Signed-off-by: Pavel Pisa --- qtmips_gui/newdialog.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'qtmips_gui/newdialog.cpp') diff --git a/qtmips_gui/newdialog.cpp b/qtmips_gui/newdialog.cpp index 53b2a05..67d3f1d 100644 --- a/qtmips_gui/newdialog.cpp +++ b/qtmips_gui/newdialog.cpp @@ -55,6 +55,7 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { connect(ui->pushButton_load, SIGNAL(clicked(bool)), this, SLOT(create())); connect(ui->pushButton_cancel, SIGNAL(clicked(bool)), this, SLOT(cancel())); connect(ui->pushButton_browse, SIGNAL(clicked(bool)), this, SLOT(browse_elf())); + connect(ui->elf_file, SIGNAL(textChanged(QString)), this, SLOT(elf_change(QString))); connect(ui->preset_no_pipeline, SIGNAL(toggled(bool)), this, SLOT(set_preset())); connect(ui->preset_no_pipeline_cache, SIGNAL(toggled(bool)), this, SLOT(set_preset())); connect(ui->preset_pipelined_bare, SIGNAL(toggled(bool)), this, SLOT(set_preset())); @@ -77,6 +78,8 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { connect(ui->osemu_unknown_syscall_stop, SIGNAL(clicked(bool)), this, SLOT(osemu_unknown_syscall_stop_change(bool))); connect(ui->osemu_interrupt_stop, SIGNAL(clicked(bool)), this, SLOT(osemu_interrupt_stop_change(bool))); connect(ui->osemu_exception_stop, SIGNAL(clicked(bool)), this, SLOT(osemu_exception_stop_change(bool))); + connect(ui->osemu_fs_root_browse, SIGNAL(clicked(bool)), this, SLOT(browse_osemu_fs_root())); + connect(ui->osemu_fs_root, SIGNAL(textChanged(QString)), this, SLOT(osemu_fs_root_change(QString))); cache_handler_d = new NewDialogCacheHandler(this, ui_cache_d); cache_handler_p = new NewDialogCacheHandler(this, ui_cache_p); @@ -144,6 +147,10 @@ void NewDialog::browse_elf() { // Elf shouldn't have any other effect so we skip config_gui here } +void NewDialog::elf_change(QString val) { + config->set_elf(val); +} + void NewDialog::set_preset() { unsigned pres_n = preset_number(); if (pres_n > 0) { @@ -222,6 +229,20 @@ void NewDialog::osemu_exception_stop_change(bool v) { config->set_osemu_exception_stop(v); } +void NewDialog::browse_osemu_fs_root() { + QFileDialog osemu_fs_root_dialog(this); + osemu_fs_root_dialog.setFileMode(QFileDialog::DirectoryOnly); + if (osemu_fs_root_dialog.exec()) { + QString path = osemu_fs_root_dialog.selectedFiles()[0]; + ui->osemu_fs_root->setText(path); + config->set_osemu_fs_root(path); + } +} + +void NewDialog::osemu_fs_root_change(QString val) { + config->set_osemu_fs_root(val); +} + void NewDialog::config_gui() { // Basic ui->elf_file->setText(config->elf()); @@ -246,6 +267,7 @@ void NewDialog::config_gui() { ui->osemu_unknown_syscall_stop->setChecked(config->osemu_unknown_syscall_stop()); ui->osemu_interrupt_stop->setChecked(config->osemu_interrupt_stop()); ui->osemu_exception_stop->setChecked(config->osemu_exception_stop()); + ui->osemu_fs_root->setText(config->osemu_fs_root()); // Disable various sections according to configuration ui->delay_slot->setEnabled(!config->pipelined()); -- cgit v1.2.3