diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3a604ce..b3aa6aa 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,24 +1,20 @@ FROM ubuntu:lunar RUN apt-get update && apt-get install -y \ - libssl-dev gcc-13 g++-13 libprotobuf-c-dev libprotobuf-dev libgrpc-dev libfmt-dev llvm-14-dev libedit-dev libcxxopts-dev libpfm4-dev liblldb-dev libbenchmark-dev ninja-build libpcap-dev \ + libssl-dev gcc-13 g++-13 libprotobuf-c-dev libprotobuf-dev libgrpc-dev libfmt-dev llvm-14-dev libedit-dev libcxxopts-dev libpfm4-dev liblldb-dev libbenchmark-dev ninja-build libpcap-dev libopenblas-pthread-dev \ wget git cmake ninja-build python3 python3-pip \ lsb-release software-properties-common gnupg RUN cd /opt \ - && wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz \ + && wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0-linux.tar.gz \ && tar -xzf wasi-sdk-*.tar.gz \ - && mv wasi-sdk-20.0 wasi-sdk \ - && rm wasi-sdk-20.0-linux.tar.gz - -RUN mv /opt/wasi-sdk/bin/wasm-ld /opt/wasi-sdk/bin/wasm-ld.bak \ - && echo '#!/bin/bash \n/opt/wasi-sdk/bin/wasm-ld.bak --no-check-features "$@"' | tee /opt/wasi-sdk/bin/wasm-ld \ - && chmod +x /opt/wasi-sdk/bin/wasm-ld + && mv wasi-sdk-21.0 wasi-sdk \ + && rm wasi-sdk-21.0-linux.tar.gz RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ && add-apt-repository -y "deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar-17 main" \ && apt-get update \ && apt-get install -y clang-17 lldb-17 lld-17 clangd-17 \ - tmux vim gdb wabt + tmux vim gdb wabt neovim USER ubuntu diff --git a/src/wamr_export.cpp b/src/wamr_export.cpp index c8df236..19df3ba 100644 --- a/src/wamr_export.cpp +++ b/src/wamr_export.cpp @@ -374,7 +374,7 @@ void sigtrap_handler(int sig) { signal(SIGILL, sigtrap_handler); #endif call_count++; - if (snapshot_threshold != 0) + if (snapshot_threshold != 0 || checkpoint) if (call_count >= snapshot_threshold || checkpoint) { fprintf(stderr, "serializing\n"); serialize_to_file(exec_env); diff --git a/src/wamr_module_instance.cpp b/src/wamr_module_instance.cpp index f016807..e89e14a 100644 --- a/src/wamr_module_instance.cpp +++ b/src/wamr_module_instance.cpp @@ -12,10 +12,10 @@ void WAMRModuleInstance::dump_impl(WASMModuleInstance *env) { memories.push_back(local_mem); } global_data = std::vector(env->global_data, env->global_data + env->global_data_size); - LOGV(DEBUG) << env->global_data_size; - for (int i = 0; i < env->global_data_size; i++) { - LOGV(DEBUG) << env->global_data[i]; - } + // LOGV(DEBUG) << env->global_data_size; + // for (int i = 0; i < env->global_data_size; i++) { + // LOGV(DEBUG) << env->global_data[i]; + // } dump(&wasi_ctx, &env->module->wasi_args); if (wamr->is_aot) { diff --git a/test/counter.c b/test/counter.c index 278b2e1..96eaac4 100644 --- a/test/counter.c +++ b/test/counter.c @@ -2,6 +2,8 @@ #include int a(int c){ static int b=0; + b++; + printf("%d %d\n",c,b); // printf("\n"); } int main(int argv,char ** argc){