Skip to content

Commit 1ae01d9

Browse files
committed
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.
1 parent 9154b53 commit 1ae01d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Debug/debugger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,15 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx,
392392
v->value.uint64);
393393
break;
394394
case F32:
395-
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIx32) "\"",
395+
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIi32) "\"",
396396
v->value.uint32);
397397
break;
398398
case F64:
399-
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"",
399+
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIi64) "\"",
400400
v->value.uint64);
401401
break;
402402
default:
403-
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"",
403+
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIi64) "\"",
404404
v->value_type, v->value.uint64);
405405
}
406406
this->channel->write(R"({"idx":%d,%s}%s)", idx, buff, end ? "" : ",");

0 commit comments

Comments
 (0)