Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
.vscode/
.cache/
.ccls

*.bin
Expand Down
6 changes: 6 additions & 0 deletions platforms/CLI-Emulator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,12 @@ int main(int argc, const char *argv[]) {
} else {
wac->run_module(m);
}

if(m->exception) {
fprintf(stderr, "wdcli: exception: %s\n", m->exception);
return 1;
}

wac->unload_module(m);
wac->debugger->stop();

Expand Down
9 changes: 9 additions & 0 deletions src/Debug/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx,
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"",
v->value.uint64);
break;
case V128:
// we'll just use hex-strings
// 64-bit = 8 bytes = 16 nibbles = 16 hex-characters
snprintf(buff, 255, R"("type":"V128","value":"%016lx%016lx")",
v->value.simd.i64x2[0], v->value.simd.i64x2[1]);
break;
default:
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"",
v->value_type, v->value.uint64);
Expand Down Expand Up @@ -574,6 +580,9 @@ void Debugger::dumpLocals(const Module *m) const {
snprintf(_value_str, 255, R"("type":"F64","value":%.7f)",
v->value.f64);
break;
case V128:
snprintf(_value_str, 255, R"("type":"V128","value":"%016lx%016lx")",
v->value.simd.i64x2[0], v->value.simd.i64x2[1]);
default:
snprintf(_value_str, 255,
R"("type":"%02x","value":")" FMT(PRIx64) "\"",
Expand Down
Loading
Loading