如何在gogland调试应用程序?
问题描述:
我想用Jetbrain的gogland调试器来调试我的软件应用程序,但gogland运行配置允许设置包或文件运行方案,而不是由revel run myapp
开始的调试过程。如何在gogland调试应用程序?
答
现在Gogland是Goland
我找到创建调试配置官方manual。我会张贴在这里,如果你不介意的话......
的IntelliJ调试(的Goland)
- 创建项目,在这个例子中我将使用规范“随缘新github.com/myaccount /我的应用程序内”
- ‘随缘运行github.com/myaccount/my-app’生成TMP/main.go - 是的IntelliJ
- 关闭正在运行的服务器
- 创建运行配置,并在需要这个文件“程序参数”添加“-importPath git hub.com \我的帐户\我的应用程序内-srcPath的\ src -runMode开发”
- 点‘文件’的\ src \ github.com \我的账户\我的应用程序内\程序\ tmp目录\ main.go
- 在“在启动之前“添加”运行外部工具“。有:程序:\ BIN \随缘文件(.exe)Paramerets:建立github.com/myaccount/my-app
它适用于Linux的&的Windows
答
AFAIK,Gogland内置调试器是delve。
,我认为你必须尝试运行调试与选项attach
:
Attach to an already running process and begin debugging it. This command will cause Delve to take control of an already running process, and begin a new debug session. When exiting the debug session you will have the option to let the process continue or kill it. Usage: dlv attach pid [flags]
我没有安装gogland了,但我在过去也有类似的问题。
调试进程尚未实现(Gogland EAP 7)。这里有相关的问题,你可以按照获取更新:https://youtrack.jetbrains.com/issue/GO-620 –
感谢您的链接。 – zdebra