Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Air with Dlv and breakpoints does not work #628

Open
hamidrabedi opened this issue Jul 20, 2024 · 1 comment
Open

Air with Dlv and breakpoints does not work #628

hamidrabedi opened this issue Jul 20, 2024 · 1 comment

Comments

@hamidrabedi
Copy link

I added this config to my air.toml:

root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
  bin = "app"
  cmd = "go build -o ./tmp/app.exe ."
  exclude_dir = ["vendor", "tmp", "node_modules"]
  include_ext = ["go", "tmpl", "html"]
  exclude_file = []
  full_bin = "dlv exec --continue --accept-multiclient --listen=:2345 --headless=true --api-version=2 --log ./tmp/app"
  log = "air.log"

and ran the project with command air, now I added a runtime.Breakpoint() in the middle of code.
so when I run the code with dlv debug and gets to the breakpoints, it stops and gives me an interactive shell so I can write some commands and stuff. how can I achieve that with air and dlv together?

these are the logs if it helps

2024-07-20T16:24:20+03:30 debug layer=debugger callInjection protocol on:
2024-07-20T16:24:20+03:30 debug layer=debugger  12032 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  12500 PC=0x7ffd09610ff4
2024-07-20T16:24:20+03:30 debug layer=debugger  46868 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  37032 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  50296 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  8656 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  47012 PC=0x4f3461
2024-07-20T16:24:20+03:30 debug layer=debugger  49668 PC=0x7ffd09610ff4
2024-07-20T16:24:20+03:30 debug layer=debugger  42716 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  50024 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  46540 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  47768 PC=0x7ffd09610ff4
2024-07-20T16:24:20+03:30 debug layer=debugger  51760 PC=0x7ffd09610394
2024-07-20T16:24:20+03:30 debug layer=debugger  52148 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  1896 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  37844 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 debug layer=debugger  51264 PC=0x7ffd0960d5e4
2024-07-20T16:24:20+03:30 error layer=rpc writing response:write tcp 127.0.0.1:2345->127.0.0.1:63696: use of closed network connection
@hamidrabedi hamidrabedi changed the title air with dlv and breakpoints does not work Air with Dlv and breakpoints does not work Jul 20, 2024
@RokeAlvo
Copy link

RokeAlvo commented Sep 4, 2024

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants