-
Hello, I'm trying to debug an issue with my code and I would like to use Delve (dlv) to do so. I have a basic bubbletea program which I start with bubbletea.NewProgram. When I start it under dlv (i.e. dlv debug -> continue) the continue loop seems stuck and I do not see any output. Should I be doing something special to use Delve? Here it my set of goroutines in case something is blocked there: (dlv) goroutines
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since BubbleTea apps are in control of stdin/stdout, you need to start it in a headless delve debugger, and then connect to it: # Start the debugger:
$ dlv debug --headless .
API server listening at: 127.0.0.1:34241
# Connect to it from another terminal:
$ dlv connect 127.0.0.1:34241 Note that the default port used will vary on your system and per run, so actually watch out what address the first dlv run tells you to connect to! |
Beta Was this translation helpful? Give feedback.
Since BubbleTea apps are in control of stdin/stdout, you need to start it in a headless delve debugger, and then connect to it:
Note that the default port used will vary on your system and per run, so actually watch out what address the first dlv run tells you to connect to!