尝试使用 dlv (delve) 查看 go 程序产生的 core dump #39
binderclip
started this conversation in
notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
#16 中产生了 core dump 文件,接下来尝试用 dlv 工具查看一下;
在 dlv 中:
第一次错误执行的结果:
关于 locals 看不到的猜测:
go run临时编译的版本,但 core dump 的是go build生产的版本,所以对应不上Warning: debugging optimized function,被优化过,所以不能正确查看Unreadable arguments and "debugging optimized function" warning · Issue #1368 · go-delve/delve
go build -gcflags="all=-N -l" app.go之后生成的文件可以用 dlv 查看变量值了:Beta Was this translation helpful? Give feedback.
All reactions