1

I'm trying to attach the lldb debugger (from VS Code) to the new try-runtime client. However the breakpoints I setup inside the chain code on on_upgrade are never reached (Obliviously because they are running from wasm code)

launch.json:

    {
        "type": "lldb",
        "request": "launch",
        "name": "Debug try runtime",
        "cargo": {
            "args": [
                "build",
                "--features",
                "try-runtime"
            ],
        }, 
        "program": "/home/user/.cargo/bin/try-runtime",
        "args": ["--runtime",
                 "./target/debug/wbuild/runtime-icecream/runtime_icecream.wasm",
                 "on-runtime-upgrade",
                 "snap",
                 "-p",
                 "snapshots/icecream"

    ],
        "cwd": "${workspaceFolder}"
    },

Is there any way I could setup the debugger to try-runtime?

2 Answers 2

2

Not without significant change to try-runtime-cli. Suggest using logging for your debug.

2

I solved this problem by chaining the point of view. It is possible to attach a debugger to the try-runtime project and treat the chain code as a black box. Observing the input and the output gave me the relevant clues I needed.

git clone https://github.com/paritytech/try-runtime-cli.git

Link to the chain project from launch.json configuration file and debug with F5 as usual.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug executable 'try-runtime on-runtime-upgrade'",
            "cargo": {
                "args": [
                    "build",
                    "--bin=try-runtime",
                    "--package=try-runtime-cli",
                ],
                "filter": {
                    "name": "try-runtime",
                    "kind": "bin"
                }
            },
            "args": [
                "--runtime",
                "/home/iceman/nodle/chain/target/release/wbuild/runtime-icecream/runtime_icecream.wasm",
                "on-runtime-upgrade",
                "snap",
                "-p",
                "/home/iceman/nodle/chain/snapshots/icecream"
                ],
            "cwd": "${workspaceFolder}"
        }
    ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.