k, after that confusion, have reproduced the regression I wanted. with latest everything, breakpoints using wasmtime work, breakpoints using c-api/dll don't. repro incoming.
think the problem is picking up wrong version of wasmtime.dll or system can't find it. debug is really sensitive with that stuff, so most robust way seems to be to build c-api static.
gpt doesn't know how to do that, current tree, it says do this then build as normal.
set WASMTIME_STATIC_LIB=1
set WASMTIME_STATIC=1
... but trying to bind to that output get a bunch of unresolved.
Steve Williams has marked this topic as unresolved.
got static c-api test working. need to define
WASM_API_EXTERN=;WASI_API_EXTERN=
& bind libs no longer pulled from dll we're no longer referencing.
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "advapi32.lib")
#pragma comment(lib, "userenv.lib")
#pragma comment(lib, "ntdll.lib")
#pragma comment(lib, "shell32.lib")
#pragma comment(lib, "ole32.lib")
#pragma comment(lib, "bcrypt.lib")
or however.
breakpoints not working for me, static c-api also, but from wasmtime.exe they work.
just a minute, this could be false alarm too. my test broken. sorry :)
.
as of right now c-api debugging using wasm instead of wasmtime interfaces not working for me on windows.
it could still be user error, but growing increasingly confident there's an issue. repro to follow
this : https://docs.wasmtime.dev/c-api/
doesn't explain how to build c-api static or how to bind to it. process is above, as far as I can figure.
looking for a c-api app that loads fizzbuzz.wasm with debug
PastedText.txt
output there - same wasm, run from wasmtime & c_api app. wasmtime can break, c_api app cannot.
repro in a minute.
repro: http://advance-software.com/misc/test_breakpoint.zip
to reproduce, build your wasmtime.exe & put it in dist subdirectory. there's a 0 length placeholder there right now.
Platform: Windows 11/64
should then be able to : lldb -- .\wasmtime.exe -D debug-info --invoke app_init .\breakable.wasm
(lldb) b app_init
(lldb) r
& that works (for me)
then build the c-api test in host, using visual studio 2022 : a couple of hardwired paths in there to change but its mostly portable. resulting .exe should end up in dist subdir, overwriting the 0 length placeholder.
run it directly to verify it works (from dist) : .\test_wasmtime_debug_api.exe .\breakable.wasm
should get result : 42
then run under lldb : lldb -- .\test_wasmtime_debug_api.exe .\breakable.wasm
(lldb) b app_init
(lldb) r
breakpoint not hit. that's the bug.
source to breakable.wasm is in wasm subdir - its trivial.
tried c-api buiit static & dynamic. static my preference.
difference (guess) : wasmtime likely uses wasmtime API, the C API test uses the wasm API.
If anything isn't clear or anyone spots an obvious error, please just say.
@Steve Williams thanks for your interest. I've given this feedback in a few different ways before but I'll be more blunt this time: Zulip is not the place for a stream of consciousness. If you have specific questions, feel free to ask them, but a haphazard sequence of ~50 messages just from you, with no conversation, is not the appropriate use of this forum.
To your specific topic, native debugging is known to be unreliable and we're working on an alternative, but it isn't ready yet. That's the whole update, sorry.
dude, it's a repro for a regression.
its unreliable bcoz dll sensitivity on windows, that's why I'm trying to get it running static.
debugging does work. via wasmtime, it works. it doesn't work c-api. so whatever wasmtime is doing, c-api needs to. if I need to personally debug it, I guess that's tomorrow's job.
Please file an issue on GitHub then. Your stream-of-consciousness Zulip topics are difficult to follow and waste maintainers' time. Thanks.
https://github.com/bytecodealliance/wasmtime/issues/11846
k, so it's debug time. grok says this triggers breakpoints. posting my thoughts here coz AI isn't always right so please correct if you know better.
https://x.com/i/grok/share/SFAEuYFH7BNfZc3Ui5EMzqBwI
it would be helpful to know if breakpoints have regressed from C API all platforms. I don't think this is a Windows specific issue but it may be.
Grok thinks it's identified the cause but AIs talk a lot of nonsense & I'm not familiar with the code, so who knows.
Maybe this helps.
https://x.com/i/grok/share/jTIYTmNBMlYB5YUFqS0VJvpes
https://github.com/bytecodealliance/wasmtime/issues/9909
Last updated: Dec 06 2025 at 06:05 UTC