Skip to content

Commit 53c30e2

Browse files
MaartenS11tolauwae
authored andcommitted
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 8a3b151 commit 53c30e2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Debug/debugger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,15 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx,
394394
v->value.uint64);
395395
break;
396396
case F32:
397-
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIx32) "\"",
397+
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIi32) "\"",
398398
v->value.uint32);
399399
break;
400400
case F64:
401-
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"",
401+
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIi64) "\"",
402402
v->value.uint64);
403403
break;
404404
default:
405-
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"",
405+
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIi64) "\"",
406406
v->value_type, v->value.uint64);
407407
}
408408
this->channel->write(R"({"idx":%d,%s}%s)", idx, buff, end ? "" : ",");

0 commit comments

Comments
 (0)