添加-ldflags "-s"选项后会忽略调试信息,导致gdb不能调试
This commit is contained in:
@@ -123,7 +123,7 @@ GDB的一些常用命令如下所示
|
|||||||
|
|
||||||
编译文件,生成可执行文件gdbfile:
|
编译文件,生成可执行文件gdbfile:
|
||||||
|
|
||||||
go build -gcflags "-N -l" -ldflags "-s" gdbfile.go
|
go build -gcflags "-N -l" gdbfile.go
|
||||||
|
|
||||||
通过gdb命令启动调试:
|
通过gdb命令启动调试:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user