From 7262d30e9e689aaacd7926c90d953ab86cd9cfa7 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 2 Jul 2019 18:07:37 +0200 Subject: Implement load of sources in emscripten build and minor fixes. Signed-off-by: Pavel Pisa --- qtmips_machine/qtmipsmachine.cpp | 4 +++- qtmips_machine/qtmipsmachine.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'qtmips_machine') 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(); -- cgit v1.2.3