aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/qtmipsmachine.cpp
diff options
context:
space:
mode:
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;
}