【发布时间】:2020-03-21 11:29:04
【问题描述】:
问题的原始形式(本身并不完全是一个问题):无法找到进程 ID 的 Mach 任务端口:(os/kern)失败(0x5)。 (请检查 gdb 是否经过代码签名 - 参见 taskgated(8))
我希望有人能提及他们所拥有的关于获得在没有 sudo 的情况下运行 gdb 的能力的任何信息,但只要运行就可以了。
我已经按照https://github.com/cs01/gdbgui/issues/55 的说明以及我现在可以找到的几乎所有相关的 stackoverflow 和 OSXdaily 提要进行了大约一周的操作。我知道有很多关于这个错误的文档,但到目前为止还没有发布这些输出并且正在运行 Catalina。我在 Mac OSX Catalina 10.15.1 上运行 gdb 8.3,配置为“x86_64-apple-darwin19.0.0”
我在 System 中创建了证书,然后在 Login 中创建了证书,结果没有任何变化。
我在 gdb 和主目录的 .gdbinit 文件中都有 set startup-with-shell off。
我最终能够使用 sudo gdb ./a.out 运行 gdb,但当我在 gdb 中使用 r 运行代码时却收到奇怪的消息:
(No debugging symbols found in ./a.out) (gdb) r Starting program: /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out [New Thread 0xc03 of process 906] [New Thread 0xf03 of process 906] During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.```(No debugging symbols found in ./a.out) (gdb) b main Breakpoint 1 at 0x100000f64 (gdb) r Starting program: /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out [New Thread 0xd03 of process 768] [New Thread 0x1003 of process 768] During startup program terminated with signal ?, Unknown signal.```Reading symbols from /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out.dSYM/Contents/Resources/DWARF/a.out... (gdb) b main Breakpoint 1 at 0x100001753: file SSSv1-1.c, line 99. (gdb) r Starting program: /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out [New Thread 0xb03 of process 717]```Reading symbols from /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out.dSYM/Contents/Resources/DWARF/a.out... (gdb) b main Breakpoint 1 at 0x100001753: file SSSv1-1.c, line 99. (gdb) r Starting program: /Users/zanekarl/Documents/Work-Documents//Programming/-code-snippets/a.out Unable to find Mach task port for process-id 680: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8))```
【问题讨论】:
-
当您在等待答案时,您可以在 linux 虚拟机中使用 lldb 或 gdb,Vagrant 非常方便。
-
@NegativeChameleon 谢谢,我会同时看看那些。
标签: c debugging gdb keychain macos-catalina