Hey guys. been a while. Upgrading our wasmtime interface (Windows, Visual Studio C/C++)
Got this : https://pastebin.com/pWJA8sRU
VS2019 : cannot convert argument 2 from 'wasm_val_t [3]' to 'const wasm_val_vec_t *
I just cast it or there's something more fundamental that's changed ? Can't immediately spot a wasm_func_call example, latest API.
Thanks for any assistance.
Upgrading to 0.29 as that's latest posted release.
nvm, I got it. need to patch as follows :
wasm_val_vec_t _in = WASM_ARRAY_VEC(in);
wasm_val_vec_t _out = WASM_ARRAY_VEC(&out);
if (wasm_func_call(m_assembly.m_init_fn, &_in, &_out))
thanks once again for all the hard work on this. might get debugger up & running this time around :)
might be wrong but quick inspect looks like extra indirection per function call. hence perf penalty. assume was necessary for some reason.
seems reason is to attempt to catch API misuse by trusted code. not sure that's optimal. trusted code should be correct. overhead every call because someone somewhere can't write correct trusted code isn't perhaps the way. my 2c on that.
I'd have stuff like that in asserts or debug only path somehow.
All for diagnostics to spot coding errors, but they should be behind macros so they're disabled in final release build.
& needed another macro as WASM_ARRAY_VEC doesn't calc correctly if there's a single non-array entry. (size 0 incorrectly determined)
// For single element entries.
#define WASM_VEC(x) { 1, &(x) }
our stuff running 0.29 now - yay :)
happy to post above wherever wasm API issues are tracked if it passes group sanity check as this isn't wasmtime specific.
so fast path would just pass wasm_val_vec_t -> data effectively reverting to previous implementation.
Above can wait unless anyone sees urgency. Had another look at debugging. Still fails for me :(
Tried reproducting this : YouTube - Debugging WebAssembly with LLDB
On windows, using llvm 12.01 wasmtime 0.29 cargo/rustc latest, the breakpoint isn't hit.
Project files here : http://advance-software.com/misc/fizzbuzz.zip
2 binaries in there - wasmtime & python36 - replace with your own to ensure secure test.
Can anyone reproduce that debug example on windows plz :)
Discussion with Yuri from ages ago here - updated.
https://github.com/bytecodealliance/wasmtime/issues/1850
Seems to work for him but not for me.
Wanting basic command line reproducing example before experimenting further with VSCode.
Could be I have the Cargo.toml wrong - I'm not a rust guy so could be something obviously stupid there. I guessed at it.
thanks in advance for any assistance. gave up on debugging last time I tried, but to move to production, we need this working.
Is Yuri still the goto guy on this ? I know there have been some changes, but haven't kept up as have been busy with other stuff.
.
connected with yuri on mozilla/matrix thingy/web assembly group
tested fizzbuzz debugging example linux (ubuntu) with llvm 10 installed. works. so have a sane project config & its platform issue of some kind.
tested llvm 10 windows - same version that worked under linux. no joy so a bug of some kind. yuri said windows implementation was a bit flaky so fun times ahead fixing that.
Updated : advance-software.com/misc/fizzbuzz.zip
bug_report.txt in there provides repro steps & files required to reproduce.
happy to do what I can to help get this resolved as should make a contribution if I'm using this too & if its a windows issue, I'm as well placed as anyone to figure it out. that said, input welcome - debuggers scare me :)
& over here : https://discord.com/channels/636084430946959380/636732809708306432
fun times :)
https://lldb.llvm.org/status/status.html
says JIT not implemented Windows yet - so that'd explain it :)
however docs could be out of date.
... but this says it does work, so I'm confused.
https://lists.llvm.org/pipermail/lldb-dev/2015-December/009003.html
& lli tool referenced is nowhere to be seen.
https://reviews.llvm.org/D15172
appears to be a 1 line change that if I'm following claims to fix it.
I'll roll my own lldb tomorrow if still required. gonna debug a debugger :)
Bulding llvm trunk. This gets fixed.
llvm building from a vs2019 x64 prompt as per build instructions here.
https://github.com/llvm/llvm-project
tried from a mozilla-build prompt - no joy but that's not essential.
update: need to perform "ninja" (as well as subprojects clang & lldb) in build dir to create all dependencies required to run lldb jit/gdb test which is failing for me. its a monster - 140GB required for full debug build of required dependencies. current status on discord.
Last updated: Nov 22 2024 at 16:03 UTC