作者:mobiledu2502900677 | 来源:互联网 | 2023-10-10 21:32
今天折腾了下Golang的调试工具gdb和lldb,遇到了一些问题,在这里记录下方便以后查找,也给遇到的小伙伴门一些参考。(只针对macOS系统)生成证书报错mac创建证书未知错误
今天折腾了下 Golang的调试工具gdb和lldb, 遇到了一些问题, 在这里记录下方便以后查找,也给遇到的小伙伴门一些参考。(只针对macOS系统)
生成证书报错
mac 创建证书 未知错误 = -2147414007
可以先生成一个 登陆
证书,然后将证书移动到 系统
那一类就行了
gdb 安装
gdb调试报错
Unable to find Mach task port for process-id 23330: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
如果是 Mojave (10.14) 之前
的系统
codesign -fs gdb-cert $(which gdb) #gdb-cert为证书名
如果是 Mojave (10.14) 之后
的系统,先创建一个文件 gdb-entitlement.xml,内容为:
com.apple.security.cs.debugger
然后执行
codesign --entitlements gdb-entitlement.xml -fs gdb-cert $(which gdb)
gdb, lldb加断点报错
lldb 加断点报错
WARNING: Unable to resolve breakpoint to any actual locations.
gdb加断点报错
No symbol table is loaded. Use the "file" command.
打包时加上 -ldflags=-compressdwarf=false
参考资料:
https://stackoverflow.com/questions/52534287/debug-go-program-with-gdb-on-macos
https://sourceware.org/gdb/wiki/PermissionsDarwin