英文:
How to Use Intellij idea14.0.2 to Debug the golang?
问题
调试按钮被禁用,按下Shift+Alt+F9将显示如下内容:
如何正确配置调试页面?
英文:
The Debug button is disable, <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>F9</kbd> will show this:
How to properly configure the debug page?
答案1
得分: 10
更新。自2015年9月起,Go插件在Linux和Mac上支持Delve,在2016年1月起在Windows上支持Delve。
原始答案:
目前,我们正在放弃对gdb调试器的支持,因为它非常难以使用且不稳定。请参阅Go文档中关于gdb调试的内容。
然而,正在努力使开源的Delve调试器支持IDE,这也将使IDEA受益。
请向Go团队提出请求,支持Delve或其他调试器,以获得稳定的解决方案,然后可以进行与IDEA的集成。
英文:
Update. The Go plugin supports Delve on Linux and Mac since September 2015 and on Windows since January 2016.
Original answer:
Currently we are dropping support for the debugger with gdb as it's very hard to use and unstable. Please see the go docs for gdb debugging
However, there are efforts in getting the open-source Delve debugger support for IDEs from which IDEA will benefit as well.
Please bug the Go team to support Delve or another debugger in order to have a stable solution and then integration with IDEA could be done.
答案2
得分: 3
你好,以下是翻译好的内容:
感谢,问题已解决。
Intellij配置不正确。
英文:
thanks ,solved it.
Intellij Config is not right
答案3
得分: 1
> 正确的方法是在IntelliJ中实现调试器接口,并将其连接到正在运行的gdb进程中。
(这是一个手动调用gdb调试Go程序的示例;使用选项-c -gcflags '-N -l'
:不确定-l
是否重要,因为它在OP的截图“Go builder arguments”中缺失)
如果没有为Go调试进程配置gcc,则可能会禁用调试按钮。
还要注意自PR 644以来:
> 如果未启用“运行前构建”,则“调试”将被禁用。
这应该解决问题,当gdb
想要运行一个不存在的可执行文件时,因为outputDir
未设置。
英文:
The debug feature was introduced by issue 25, and commit 3a21e14
> The correct way is to implement the debugger interfaces in inteliij and to hook them to a running gdb process.
(Here is an example of manually calling gdb to debug a Go program; using the options -c -gcflags '-N -l'
: not sure if the -l
would matter as it is missing from the OP's screenshot "Go builder arguments
")
It is possible the debug button is disabled if no gcc is configure for the Go debug process to use.
Note also that since PR 644:
> "Debug" is disabled, if "Build Before run" is not enabled.
This should fix the problem, when gdb
wants to run a not existing executable, because the outputDir
is not set.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论