2017-04-04 89 views
0

我想用Jetbrain的gogland调试器来调试我的软件应用程序,但gogland运行配置允许设置包或文件运行方案,而不是由revel run myapp开始的调试过程。如何在gogland调试应用程序?

+1

调试进程尚未实现(Gogland EAP 7)。这里有相关的问题,你可以按照获取更新:https://youtrack.jetbrains.com/issue/GO-620 –

+0

感谢您的链接。 – zdebra

回答

1

现在Gogland是Goland

我找到创建调试配置官方manual。我会张贴在这里,如果你不介意的话......

的IntelliJ调试(的Goland)

  1. 创建项目,在这个例子中我将使用规范“随缘新github.com/myaccount /我的应用程序内”
  2. ‘随缘运行github.com/myaccount/my-app’生成TMP/main.go - 是的IntelliJ
  3. 关闭正在运行的服务器
  4. 创建运行配置,并在需要这个文件“程序参数”添加“-importPath git hub.com \我的帐户\我的应用程序内-srcPath的\ src -runMode开发”
  5. 点‘文件’的\ src \ github.com \我的账户\我的应用程序内\程序\ tmp目录\ main.go
  6. 在“在启动之前“添加”运行外部工具“。有:程序:\ BIN \随缘文件(.exe)Paramerets:建立github.com/myaccount/my-app

它适用于Linux的&的Windows

0

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了,但我在过去也有类似的问题。

+0

事情是,我不想分开安装钻石。我宁愿使用gogland的捆绑二进制delve并使用gogland中的GUI调试器。 – zdebra

+0

事实上,我已经安装了gogland。我在bin中发现了'dlv'。但我没有找到自定义'dlv'开始的可能性。 比我看这里:https://youtrack.jetbrains.com/issues/GO?q=dlv%20attach 我没有看到配置附加从戈兰pid的可能性。 – Ingaz