gointellij-ideagoogle-go-idea-plugin

How to attach IntelliJ Go debugger to local process


I'm coding in Go using IntelliJ IDEA with Go plugin. I am working on a project that uses gocui, which doesn't work in IntelliJ console window. So I run my program from console.

How can I attach this wonderful IntelliJ debugger to the process that runs outside IntelliJ (in my console)? I tried run -> attach to local process, but it showed an empty box.


Solution

  • Unfortunately right now the plugin does not support this feature. You can track the request for it here: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/620

    However, be warned that delve does not support attaching to a running process on Windows (in case that's your OS).

    You can also track the request here: https://youtrack.jetbrains.com/issue/GO-620 for Gogland.

    I'll update this in case I find a way to help you run the app from the IDE instead so that you can debug it easier.