How to Use Intellij idea14.0.2 to Debug the golang?

20,521

Solution 1

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.

Solution 2

enter image description here

thanks ,solved it. Intellij Config is not right

Solution 3

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.

Share:
20,521
Eric
Author by

Eric

Updated on March 08, 2020

Comments

  • Eric
    Eric over 4 years

    The Debug button is disable, Shift+Alt+F9 will show this:

    debug button is disabled

    How to properly configure the debug page?

    the confige page