Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WASIp2] soft debugger via sockets #109584

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Nov 6, 2024

  • allow mono soft debugger to use WASIp2 sockets, which are almost unix like
    • drop mini-wasi-debugger.c and make few #ifdef in debugger-agent.c
    • make WASI socket_transport_recv to use MSG_DONTWAIT when called from interp loop
  • remove debugger_fd pre-opened socket file descriptor
  • make sure that libmono-component-debugger-stub-static.a is not linked intree
  • changed mono_jit_parse_options to return number of arguments that it consumed

testing

VS Code
https://marketplace.visualstudio.com/items?itemName=ms-vscode.mono-debug

  • use <_WasiDebugger>true</_WasiDebugger> in samples or
  • pass --debugger-agent=transport=dt_socket,server=y,address=localhost:55555,loglevel=0 to main()
  • and --wasi inherit-network --wasi tcp --wasi udp --wasi allow-ip-name-lookup for wasmtime permissions

.vscode\launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55555
        }
    ]
}

image

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Debugger-mono os-wasi Related to WASI variant of arch-wasm labels Nov 6, 2024
@pavelsavara pavelsavara added this to the 10.0.0 milestone Nov 6, 2024
@pavelsavara pavelsavara self-assigned this Nov 6, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@pavelsavara pavelsavara changed the title [WASI] debugger sockets [WASIp2] soft debugger via sockets Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-Debugger-mono os-wasi Related to WASI variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants