From 1ae01d946922eed80ed302c3d941f28427b9571e Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 11 Sep 2025 11:13:12 +0200 Subject: [PATCH] Debugger::printValue now uses a decimal representation for all datatypes This simplifies the frontend which no longer has to parse the value of a stack element in hex if it's a float or in decimal if it's an integer. It can just always parse it as a decimal. --- src/Debug/debugger.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Debug/debugger.cpp b/src/Debug/debugger.cpp index bafa6957..0e98de13 100644 --- a/src/Debug/debugger.cpp +++ b/src/Debug/debugger.cpp @@ -392,15 +392,15 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx, v->value.uint64); break; case F32: - snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIx32) "\"", + snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIi32) "\"", v->value.uint32); break; case F64: - snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"", + snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIi64) "\"", v->value.uint64); break; default: - snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"", + snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIi64) "\"", v->value_type, v->value.uint64); } this->channel->write(R"({"idx":%d,%s}%s)", idx, buff, end ? "" : ",");