z.k*_*arl 3 c debugging gdb keychain macos-catalina
问题的原始形式(本身不完全是问题):无法找到进程 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”
我在系统中创建了证书,然后在登录中创建了证书,结果没有变化。
我 set startup-with-shell off在主目录中的 gdb 和 .gdbinit 文件中都有。
sudo gdb ./a.out当我r在 gdb 内部运行代码时,我最终能够运行 gdb只接收奇怪的消息:
(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.```
Run Code Online (Sandbox Code Playgroud)(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.```
Run Code Online (Sandbox Code Playgroud)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]```
Run Code Online (Sandbox Code Playgroud)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))```
Run Code Online (Sandbox Code Playgroud)在运行 Catalina 10.15.2 (19C57) 的 MacBook Pro(15 英寸,2016 年)上,启用了 sip。
我通过以下方式安装了 gdb 8.3.1:
酿造安装gdb
然后在我的主文件夹中,我创建了一个包含以下内容的 gdb.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
我在系统钥匙串上创建了 gdb-cert
为了签署 gdb,我启用了 root 帐户,作为 root,我使用了以下命令:
codesign --entitlements gdb.xml -fs gdb-cert /usr/local/Cellar/gdb/8.3.1/bin/gdb
现在我可以使用 netbeans 来调试我的 Fortran 代码。
权利 xml 对我来说是缺失的部分:
Name = gdb_codesign
Identity Type = Self Signed Root
Certificate Type = Code Signing
Run Code Online (Sandbox Code Playgroud)<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)$ codesign --entitlements gdb-entitlement.xml -fs gdb_codesign $(which gdb)
$ sudo killall taskgated
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
2356 次 |
| 最近记录: |