erlang_ls icon indicating copy to clipboard operation
erlang_ls copied to clipboard

Breakpoint doesn't get hit

Open letrec opened this issue 3 years ago • 8 comments

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

letrec avatar Jun 19 '22 12:06 letrec

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: @.***>

TheGeorge avatar Jun 19 '22 12:06 TheGeorge

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: @.>

letrec avatar Jun 19 '22 13:06 letrec

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

letrec avatar Jun 19 '22 13:06 letrec

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.

fizfaz avatar Jun 26 '22 10:06 fizfaz

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.

letrec avatar Jun 26 '22 11:06 letrec

ok, I just cloned your repository and tried it, and after hitting the breakpoint it does stop and I can use the debugger:

image

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… 

fizfaz avatar Jun 26 '22 11:06 fizfaz

Hi @letrec, did you try to attach to the running node from the CLI?

robertoaloi avatar Aug 18 '22 19:08 robertoaloi

@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

CBS-70 avatar Jan 26 '23 14:01 CBS-70