英文:
How to attach IntelliJ Go debugger to local process
问题
我正在使用IntelliJ IDEA和Go插件编写Go代码。我正在处理一个使用gocui的项目,但它在IntelliJ控制台窗口中无法工作。所以我从控制台运行我的程序。
我该如何将这个很棒的IntelliJ调试器附加到在IntelliJ之外(在我的控制台中)运行的进程上?我尝试了运行->附加到本地进程,但它显示了一个空白框。
英文:
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.
1: https://github.com/jroimartin/gocui "gocui"
答案1
得分: 1
很抱歉,目前插件不支持这个功能。你可以在这里跟踪相关请求:https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/620
然而,请注意,delve不支持在Windows上附加到正在运行的进程(如果你使用的是Windows操作系统)。
你也可以在这里跟踪相关请求:https://youtrack.jetbrains.com/issue/GO-620,适用于Gogland。
如果我找到一种方法可以帮助你从IDE中运行应用程序,以便你可以更轻松地进行调试,我会更新这个信息。
英文:
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.
答案2
得分: 0
我偶然发现了一个小技巧,可以让我在IntelliJ的普通控制台中运行我的应用程序。只需从控制台中运行IntelliJ,然后如果我运行(或调试)我的应用程序,它会在那个控制台中打开。
英文:
I discovered by accident one trick that allows to run my application in normal console from IntelliJ. Simply run IntelliJ from a console. Then, if I run (or debug) my application, it opens in that console.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论