Open w4454962 opened 3 months ago
Sadly for now we don't have much support for Windows lldb, therefore you can't use the debug feature in Windows WAMR IDE. You may try other features to help debug like https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/build_wamr.md#enable-dump-call-stack-feature or https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/samples/debug-tools
thanks, I hope to support debugging in a Win32 environment in the future, even in interpreted mode.
希望对windows支持可以更好点。现在的release里也没有windows平台的包可以下载。
Sadly for now we don't have much support for Windows lldb, therefore you can't use the debug feature in Windows WAMR IDE. You may try other features to help debug like https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/build_wamr.md#enable-dump-call-stack-feature or https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/samples/debug-tools
Is windows not supported at all even if you build LLDB yourself and use the following instructions? I built lldb.exe and lldb-vscode.exe for windows and I would like to try debugging on windows.
I did notice the extension doesn't look for the correct path in isLLDBInstalled
when on windows. It uses os.platform()
which evaluates to "win32" but the instructions want to use the path with "windows" as the folder name. With some adjustments my WAMRIDE extension detects lldb on windows now, however it seems to fail when trying to launch the debug server? after the extension calls boot_debugger_server.bat
I get the following:
[14:21:59:921 - 7FDD7CF18000]: warning: allocate 544768 bytes memory failed
[14:21:59:948 - 7FDD7CF18000]: WASM Debug Engine warning: failed to allocate linear memory for execution.
Will not be able to evaluate expressions during debugging
[14:21:59:090 - 7FDD7CF0E640]: control thread of debug object 0x555ee216efe0 start
[14:21:59:172 - 7FDD7CF0E640]: Debug server listening on 0.0.0.0:1234
[14:21:59:221 - 7FDD7CF18000]: warning: allocate 28 bytes memory failed
Exception: allocate memory failed
[14:21:59:314 - 7FDD7CF0E640]: wasm gdb server error: socket accept failed
[14:21:59:325 - 7FDD7CF0E640]: Failed while accepting debugger connection
and lldb afterwards prints
Running attachCommands:
(lldb) process connect -p wasm connect://127.0.0.1:1234
error: Failed to connect port
I'm not sure if its failing because of those warnings about memory allocation or a different reason
I haven't tried this on Windows, but you can try add --heap-size=1024000 option to iwasm and it should resolve memory allocation issue
I got debugging working on the windows platform. You do have to build LLDB yourself with the supplied patch, but there's a few other issues I had to clear up to get it working:
os.platform()
when picking the path to the lldb bin folder. This way it should look in the resource\debug\windows\
folder instead of resource\debug\win32\
boot_debugger_server.bat
file to replace the docker line with a call to iwasm.exe that I had manually built:
path/to/iwasm/iwasm.exe --heap-size=%3 -g=127.0.0.1:1234 %cd%\build\%1.wasm
When installing the WAMR IDE in vscode, it prompts that LLDB does not support the Windows platform