From c975257cef23d254b1fa9290474268a61509e954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 30 Aug 2017 23:29:14 +0200 Subject: Some to_string_hex cleanups --- qtmips_machine/programmemory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qtmips_machine/programmemory.cpp') diff --git a/qtmips_machine/programmemory.cpp b/qtmips_machine/programmemory.cpp index c5ef53a..6759842 100644 --- a/qtmips_machine/programmemory.cpp +++ b/qtmips_machine/programmemory.cpp @@ -5,6 +5,7 @@ #include "instructions/loadstore.h" #include "instructions/nop.h" #include "instructions/shift.h" +#include "utils.h" ProgramMemory::ProgramMemory(ProgramLoader *loader, MemoryAccess *memory) { this->memory = memory; @@ -40,7 +41,7 @@ Instruction *ProgramMemory::at(std::uint32_t address) { } // TODO implement -#define I_UNKNOWN(DATA) do { std::stringstream ss; ss << std::hex << DATA; throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Unknown instruction, can't decode", ss.str()); } while(false); +#define I_UNKNOWN(DATA) throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Unknown instruction, can't decode", to_string_hex(DATA)) #define I_UNSUPPORTED(INST) throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Decoded unsupported unstruction", #INST) Instruction *ProgramMemory::decode_r(std::uint32_t dt) { -- cgit v1.2.3