From b7c2d05a1a83dd91052ca6df20c2f60c802e773e Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Fri, 22 Feb 2019 22:05:19 +0100 Subject: Add support for goto to selected symbol address. Signed-off-by: Pavel Pisa --- qtmips_machine/qtmipsmachine.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'qtmips_machine/qtmipsmachine.cpp') 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; } -- cgit v1.2.3