diff options
author | Karel Kočí <cynerd@email.cz> | 2017-12-11 20:36:48 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-12-11 20:36:48 +0100 |
commit | 542c4ff2b4cfea049a498d827ea35a2600235e7e (patch) | |
tree | 6060df8503a0c9e3ea59c83b173977c0c3386f20 | |
parent | 14c3682671431681c8bc39fbeb620cd1c9234694 (diff) | |
download | qtmips-542c4ff2b4cfea049a498d827ea35a2600235e7e.tar.gz qtmips-542c4ff2b4cfea049a498d827ea35a2600235e7e.tar.bz2 qtmips-542c4ff2b4cfea049a498d827ea35a2600235e7e.zip |
Fix problem with no such file or directory
Yep when object was instantiated it wasn't copying elf_path so now fixed
(should also not forget to do the same with other options too).
-rw-r--r-- | qtmips_machine/machineconfig.cpp | 1 | ||||
-rw-r--r-- | qtmips_machine/programloader.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/qtmips_machine/machineconfig.cpp b/qtmips_machine/machineconfig.cpp index f23140f..7538765 100644 --- a/qtmips_machine/machineconfig.cpp +++ b/qtmips_machine/machineconfig.cpp @@ -8,6 +8,7 @@ MachineConfig::MachineConfig() { MachineConfig::MachineConfig(MachineConfig *cc) { pipeline = cc->pipelined(); jumppred = cc->jump_prediction(); + elf_path = cc->elf(); } void MachineConfig::set_pipelined(bool v) { diff --git a/qtmips_machine/programloader.cpp b/qtmips_machine/programloader.cpp index f49fa3c..bad0a82 100644 --- a/qtmips_machine/programloader.cpp +++ b/qtmips_machine/programloader.cpp @@ -12,7 +12,7 @@ ProgramLoader::ProgramLoader(const char *file) { throw QTMIPS_EXCEPTION(Input, "Elf library initialization failed", elf_errmsg(-1)); // Open source file if ((this->fd = open(file, O_RDONLY, 0)) < 0) - throw QTMIPS_EXCEPTION(Input, "Can't open input elf file for reading", std::strerror(errno)); + throw QTMIPS_EXCEPTION(Input, QString("Can't open input elf file for reading (") + QString(file) + QString(")"), std::strerror(errno)); // Initialize elf if (!(this->elf = elf_begin(this->fd, ELF_C_READ, NULL))) throw QTMIPS_EXCEPTION(Input, "Elf read begin failed", elf_errmsg(-1)); |