From 99b0e6aba8c49f8eaba03e59ed74558ba1cca73a Mon Sep 17 00:00:00 2001 From: Greg Savin Date: Fri, 23 Sep 2022 14:47:41 -0700 Subject: [PATCH 1/3] First attempt at firefox attach debug config --- .vscode/launch.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1f91878..400fdd1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -38,6 +38,18 @@ "pathMapping": { "/.metadata/.plugins/com.sifive.freedomstudio.util/pvapp/1.0/": "${workspaceFolder}", } + }, + { + "type": "firefox", + "request": "attach", + "name": "Local Firefox Attach", + "port": 6000, + "pathMappings": [ + { + "url": "http://127.0.0.1:*/.metadata/.plugins/com.sifive.freedomstudio.util/pvapp/1.0/lib", + "path": "${workspaceFolder}/lib" + } + ] } ] } \ No newline at end of file From c1c5af40c3dbfa4013e9e9b07e2b978abc0504af Mon Sep 17 00:00:00 2001 From: Greg Savin Date: Fri, 23 Sep 2022 14:52:54 -0700 Subject: [PATCH 2/3] More inclusive wildcard --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 400fdd1..8136473 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -46,7 +46,7 @@ "port": 6000, "pathMappings": [ { - "url": "http://127.0.0.1:*/.metadata/.plugins/com.sifive.freedomstudio.util/pvapp/1.0/lib", + "url": "http://*/.metadata/.plugins/com.sifive.freedomstudio.util/pvapp/1.0/lib", "path": "${workspaceFolder}/lib" } ] From 05d0620787be863dc0cd334079d0335495c66e05 Mon Sep 17 00:00:00 2001 From: Greg Savin Date: Fri, 23 Sep 2022 16:18:14 -0700 Subject: [PATCH 3/3] add readme instructions for debugging under Firefox --- readme/vscode-dev-env.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/readme/vscode-dev-env.md b/readme/vscode-dev-env.md index 14bd028..52fb51f 100644 --- a/readme/vscode-dev-env.md +++ b/readme/vscode-dev-env.md @@ -116,6 +116,18 @@ You are on your own here. You can set breakpoints, look at variables, etc... If you make any code modifications, you will need to invoke the build/install/debug loop to run the new code. +### Firefox + +Although we currently emphasize Chrome support, it might be occasionally useful to debug an environment that uses Firefox as its default web browser. + +If that eventuality arists, then to set that up, install the Firefox debug extension to vccode (https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug). + +Open a terminal and start firefox using this command: + +`firefox --start-debugger-server` + +Then from vscode, use the launch configuration named "Local Firefox Attach" + ## Helpful Links - https://stackoverflow.com/questions/65200278/vscode-settings-how-to-get-a-hostname-when-using-remote-ssh