aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/qtmipsmachine.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-22 22:05:19 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-22 22:05:19 +0100
commitb7c2d05a1a83dd91052ca6df20c2f60c802e773e (patch)
tree9dae0d407c0848b9f703bbbc37278d445e04158b /qtmips_machine/qtmipsmachine.cpp
parent372af906107bceed8a174d5aa907034d35cfe760 (diff)
downloadqtmips-b7c2d05a1a83dd91052ca6df20c2f60c802e773e.tar.gz
qtmips-b7c2d05a1a83dd91052ca6df20c2f60c802e773e.tar.bz2
qtmips-b7c2d05a1a83dd91052ca6df20c2f60c802e773e.zip
Add support for goto to selected symbol address.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/qtmipsmachine.cpp')
-rw-r--r--qtmips_machine/qtmipsmachine.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp
index 37e5461..e1ecf93 100644
--- a/qtmips_machine/qtmipsmachine.cpp
+++ b/qtmips_machine/qtmipsmachine.cpp
@@ -39,13 +39,17 @@
using namespace machine;
-QtMipsMachine::QtMipsMachine(const MachineConfig &cc) : QObject(), mcnf(&cc) {
+QtMipsMachine::QtMipsMachine(const MachineConfig &cc, bool load_symtab) :
+ QObject(), mcnf(&cc) {
MemoryAccess *cpu_mem;
stat = ST_READY;
+ symtab = nullptr;
ProgramLoader program(cc.elf());
mem_program_only = new Memory();
program.to_memory(mem_program_only);
+ if (load_symtab)
+ symtab = program.get_symbol_table();
program_end = program.end();
regs = new Registers();
if (program.get_executable_entry())
@@ -102,6 +106,9 @@ QtMipsMachine::~QtMipsMachine() {
if (mem_program_only != nullptr)
delete mem_program_only;
mem_program_only = nullptr;
+ if (symtab != nullptr)
+ delete symtab;
+ symtab = nullptr;
}
const MachineConfig &QtMipsMachine::config() {
@@ -145,6 +152,10 @@ PeripSpiLed *QtMipsMachine::peripheral_spi_led() {
return perip_spi_led;
}
+const SymbolTable *QtMipsMachine::symbol_table() {
+ return symtab;
+}
+
const Core *QtMipsMachine::core() {
return cr;
}