From: Brendan Hansen Date: Thu, 15 Dec 2022 02:01:04 +0000 (-0600) Subject: minor bugfixes with debug info X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=c7bc631b787794aa7a3462886d9353a377211ffb;p=onyx.git minor bugfixes with debug info --- diff --git a/interpreter/src/debug/debug_runtime_values.c b/interpreter/src/debug/debug_runtime_values.c index 25683454..bc75fbd3 100644 --- a/interpreter/src/debug/debug_runtime_values.c +++ b/interpreter/src/debug/debug_runtime_values.c @@ -419,8 +419,8 @@ static u32 get_subvalues_for_type(debug_runtime_value_builder_t *builder, u32 ty count = *ptr_loc; } - if (count > MAX_SLICE_LENGTH * 4) { - count = MAX_SLICE_LENGTH * 4; + if (count > MAX_SLICE_LENGTH) { + count = MAX_SLICE_LENGTH; } return count; diff --git a/interpreter/src/debug/debug_thread.c b/interpreter/src/debug/debug_thread.c index 40ffd16b..eee4ec60 100644 --- a/interpreter/src/debug/debug_thread.c +++ b/interpreter/src/debug/debug_thread.c @@ -565,7 +565,6 @@ void *__debug_thread_entry(void * data) { } if (debug->send_buffer.length > 0) { - send(debug->client_fd, &debug->send_buffer.length, sizeof(i32), 0); send(debug->client_fd, debug->send_buffer.data, debug->send_buffer.length, 0); bh_buffer_clear(&debug->send_buffer); } diff --git a/misc/vscode/out/ovmDebug.js b/misc/vscode/out/ovmDebug.js index f6edc2cf..058e3dcd 100644 --- a/misc/vscode/out/ovmDebug.js +++ b/misc/vscode/out/ovmDebug.js @@ -593,6 +593,9 @@ class DataParser { let len = this.parseUint32(); let str = ""; for (let i = 0; i < len; i++) { + if (this.offset + i >= this.data.length) { + break; + } str += String.fromCharCode(this.view.getUint8(this.offset + i)); } this.offset += len; diff --git a/misc/vscode/ovmDebug.ts b/misc/vscode/ovmDebug.ts index 00c8c252..940f68c6 100644 --- a/misc/vscode/ovmDebug.ts +++ b/misc/vscode/ovmDebug.ts @@ -807,6 +807,10 @@ class DataParser { let len = this.parseUint32(); let str = ""; for (let i=0; i= this.data.length) { + break; + } + str += String.fromCharCode(this.view.getUint8(this.offset + i)); } this.offset += len; diff --git a/shared/lib/linux_x86_64/lib/libovmwasm.so b/shared/lib/linux_x86_64/lib/libovmwasm.so index 7d688d2e..f9bd9f97 100755 Binary files a/shared/lib/linux_x86_64/lib/libovmwasm.so and b/shared/lib/linux_x86_64/lib/libovmwasm.so differ