英文:
How to debug revel app in goland?
问题
我想使用Jetbrain的Gogland内置调试器来调试我的Revel应用程序,但是Gogland的运行配置只允许设置包或文件运行场景,而不是调试由revel run myapp
启动的进程。
英文:
I would like to debug my revel application with Jetbrain's gogland built in debugger but gogland run configuration allowing to setup either package or file run scenario not debug process started by revel run myapp
.
答案1
得分: 1
现在Gogland是Goland。
我找到了官方的创建调试配置的手册。如果你不介意的话,我会在这里发布...
INTELLIJ DEBUGGING (GOLAND)
- 创建你的项目,例如我将使用规范的“revel new github.com/myaccount/my-app”
- 运行“revel run github.com/myaccount/my-app”以生成tmp/main.go - 这个文件是IntelliJ所需的
- 关闭正在运行的服务器
- 创建运行配置,并在“Program arguments”中添加“-importPath github.com\myaccount\my-app -srcPath \src -runMode dev"
- 将“File”指向<你的gopath>\src\github.com\myaccount\my-app\app\tmp\main.go
- 在“before launch”中添加“Run external tool”。在那里:Program: <你的gopath>\bin\revel(.exe) Parameters: build github.com/myaccount/my-app
适用于Linux和Windows
英文:
Now Gogland is Goland
I find official manual for create debug-config. I'll post here if you do not mind...
INTELLIJ DEBUGGING (GOLAND)
- Create your project, for this example i will be using canonical “revel new github.com/myaccount/my-app”
- “revel run github.com/myaccount/my-app” to generate tmp/main.go - this file is needed by intellij
- Shutdown the running server
- Create run configuration and in “Program arguments” add “-importPath github.com\myaccount\my-app -srcPath \src -runMode dev"
- Point “File” to <your gopath>\src\github.com\myaccount\my-app\app\tmp\main.go
- In “before launch” add “Run external tool”. There: Program: <your gopath>\bin\revel(.exe) Paramerets: build github.com/myaccount/my-app
It works for Linux&Windows
答案2
得分: 0
据我所知,Gogland内置的调试器是delve。
我认为你应该尝试使用attach
选项来运行调试:
<pre>
附加到已经运行的进程并开始调试它。
这个命令将使Delve接管一个已经运行的进程,并开始一个新的调试会话。在退出调试会话时,你可以选择让进程继续运行或者终止它。
用法:
dlv attach pid [flags]
</pre>
我现在没有安装Gogland,但是过去我遇到过类似的问题。
英文:
AFAIK, Gogland built-in debugger is delve.
I think you must try run debug with option attach
:
<pre>
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]
</pre>
I don't have installed gogland now, but I had similar problem in past.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论