diff options
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/qtmipsmachine.cpp | 4 | ||||
-rw-r--r-- | qtmips_machine/qtmipsmachine.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp index 68eeeca..e838429 100644 --- a/qtmips_machine/qtmipsmachine.cpp +++ b/qtmips_machine/qtmipsmachine.cpp @@ -214,7 +214,9 @@ LcdDisplay *QtMipsMachine::peripheral_lcd_display() { return perip_lcd_display; } -const SymbolTable *QtMipsMachine::symbol_table() { +const SymbolTable *QtMipsMachine::symbol_table(bool create) { + if (create && (symtab == nullptr)) + symtab = new SymbolTable; return symtab; } diff --git a/qtmips_machine/qtmipsmachine.h b/qtmips_machine/qtmipsmachine.h index ef96e09..e5bbdb3 100644 --- a/qtmips_machine/qtmipsmachine.h +++ b/qtmips_machine/qtmipsmachine.h @@ -76,7 +76,7 @@ public: SerialPort *serial_port(); PeripSpiLed *peripheral_spi_led(); LcdDisplay *peripheral_lcd_display(); - const SymbolTable *symbol_table(); + const SymbolTable *symbol_table(bool create = false); void set_symbol(QString name, std::uint32_t value, std::uint32_t size, unsigned char info = 0, unsigned char other = 0); const Core *core(); |