From 0c018d6919d415c737d0f2aced227347ef226d26 Mon Sep 17 00:00:00 2001 From: ralph squillace Date: Wed, 12 Mar 2025 19:34:55 +0100 Subject: [PATCH 1/2] adding basic debug lldb config for vscode codelldb extension --- .vscode/launch.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e304382 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + // 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": "LLDB Debug", + "program": "wasmtime", + "args": [ + "serve", + "-D", + "debug-info=y", + "--dir", + ".", + "${workspaceFolder}/target/wasm32-wasip1/debug/sample_wasi_http_rust.wasm", + ], + "cwd": "${workspaceFolder}" + } + ] +} From 04b099a2901666b4776933dbdc44e38eb1c31be2 Mon Sep 17 00:00:00 2001 From: ralph squillace Date: Thu, 13 Mar 2025 15:05:50 +0100 Subject: [PATCH 2/2] added GDB, build tasks before debug --- .vscode/launch.json | 25 ++++++++++++++++++++++++- .vscode/tasks.json | 15 +++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json index e304382..b38422f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,6 +8,7 @@ "type": "lldb", "request": "launch", "name": "LLDB Debug", + "preLaunchTask": "Build WebAssembly", "program": "wasmtime", "args": [ "serve", @@ -15,9 +16,31 @@ "debug-info=y", "--dir", ".", - "${workspaceFolder}/target/wasm32-wasip1/debug/sample_wasi_http_rust.wasm", + "${workspaceFolder}/target/wasm32-wasip1/debug/sample_wasi_http_rust.wasm" ], "cwd": "${workspaceFolder}" + }, + { + "name": "GDB debug", + "type":"cppdbg", + "request": "launch", + "preLaunchTask": "Build WebAssembly", + "program": "/home//.wasmtime/bin/wasmtime", + "args": [ + "serve", + "-D", + "debug-info=y", + "--dir", + ".", + "${workspaceFolder}/target/wasm32-wasip1/debug/sample_wasi_http_rust.wasm" + ], + "cwd": "${workspaceFolder}", + "MIMode": "gdb", + "setupCommands": [ + { + "text": "-enable-pretty-printing", + } + ] } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4b6bd4f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build WebAssembly", + "type": "shell", + "command": "cargo component build", + "group": "build", + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} \ No newline at end of file