erlang_ls
erlang_ls copied to clipboard
Breakpoint doesn't get hit
Describe the bug I have a breakpoint in the project which doesn't get hit even though the corresponding code gets executed and VS Code hangs initially.
To Reproduce
I rebar3ized cowboy sample application to demonstrate the issue: https://github.com/letrec/erl_test
Run the "start" configuration
Set a breakpoint in erl_test/src/toppage_h.erl line 11
Execute curl -i http://127.0.0.1:8080
Expected behavior The breakpoint gets hit when the corresponding code gets to run.
Actual behavior The breakpoint doesn't get hit.
Context
erlang_lsversion (tag/sha): VS Code extension 0.0.35- Editor used: VS Code 1.68.1 on WIndows 11 with Ubuntu 20.04 running on WSL2
- LSP client used: Not sure what this means
Can you share your debugger configuration?
On Sun, Jun 19, 2022, 13:44 letrec @.***> wrote:
Describe the bug I have a breakpoint in the project which doesn't get hit even though the corresponding code gets executed and VS Code hangs initially.
To Reproduce I rebar3ized cowboy sample application to demonstrate the issue: https://github.com/letrec/erl_test Run the "start" configuration Set a breakpoint in erl_test/src/toppage_h.erl line 11 Execute curl -i http://127.0.0.1:8080
Expected behavior The breakpoint gets hit when the corresponding code gets to run.
Actual behavior The breakpoint doesn't get hit.
Context
- erlang_ls version (tag/sha): VS Code extension 0.0.35
- Editor used: VS Code 1.68.1 on WIndows 11 with Ubuntu 20.04 running on WSL2
- LSP client used: Not sure what this means
— Reply to this email directly, view it on GitHub https://github.com/erlang-ls/erlang_ls/issues/1342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHLD6GYPTW4TGFBBZQZR3VP4IZZANCNFSM5ZGKRT5Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Could you advise how to do that? I'm not sure what that entails.
Can you share your debugger configuration? … On Sun, Jun 19, 2022, 13:44 letrec @.> wrote: Describe the bug I have a breakpoint in the project which doesn't get hit even though the corresponding code gets executed and VS Code hangs initially. To Reproduce I rebar3ized cowboy sample application to demonstrate the issue: https://github.com/letrec/erl_test Run the "start" configuration Set a breakpoint in erl_test/src/toppage_h.erl line 11 Execute curl -i http://127.0.0.1:8080 Expected behavior The breakpoint gets hit when the corresponding code gets to run. Actual behavior The breakpoint doesn't get hit. Context - erlang_ls version (tag/sha): VS Code extension 0.0.35 - Editor used: VS Code 1.68.1 on WIndows 11 with Ubuntu 20.04 running on WSL2 - LSP client used: Not sure what this means — Reply to this email directly, view it on GitHub <#1342>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHLD6GYPTW4TGFBBZQZR3VP4IZZANCNFSM5ZGKRT5Q . You are receiving this because you are subscribed to this thread.Message ID: @.>
I'm running Erlang/OPT 25.0.1 built using kerl with the following configuration:
KERL_BUILD_DOCS=no
KERL_DEFAULT_INSTALL_DIR=~/kerl
KERL_ENABLE_PROMPT=no
KERL_INSTALL_MANPAGES=no
If you are following How To: Use the Debugger does this work for you? Especially important is the Launch configuration to basically describe the which node it should connect.
I do follow it (you can seet how exactly at https://github.com/letrec/erl_test/blob/master/.vscode/launch.json) and it doesn't work.
ok, I just cloned your repository and tried it, and after hitting the breakpoint it does stop and I can use the debugger:

Apart from using Erlang 25 (and not 25.0.1) I have the same versions of the VScode-extension and erlang-ls installed. But I am on mac OSX (11.6.6), since I don't have a windows machine, I can't help more…
Hi @letrec, did you try to attach to the running node from the CLI?
@robertoaloi I cant attach on window too, but start with default rebar shell work well
And there is a warning at attach Value is not accepted. Valid values: "launch".
BTW, docker has same situation
newest vs code and erlang ls
my code:
rebar3 new app test
cd test
rebar3 shell --name [email protected] --setcookie test
add to launch.json
{
"name": "Existing Erlang Node",
"type": "erlang",
"request": "attach",
"projectnode": "[email protected]",
"cookie": "test",
"timeout": 300,
"cwd": "${workspaceRoot}"
}
add breakpoint to test_app:stop/1
run debug
test_app:stop(1).
not break