gpt4 book ai didi

c - 在 Mac OS Catalina 中,所有当前文档均因无法找到进程 ID 的 Mach 任务端口而失败,有什么建议吗?

转载 作者:行者123 更新时间:2023-11-30 16:09:45 25 4
gpt4 key购买 nike

问题的原始形式(本身不完全是一个问题):无法找到进程 ID 的 Mach 任务端口:(os/kern)失败(0x5)。 (请检查 gdb 是否经过协同设计 - 请参阅 taskgate(8))

我希望有人能够提及他们所拥有的有关获得在没有 sudo 的情况下运行 gdb 的能力的任何信息,但只要运行就可以了。

我已按照 https://github.com/cs01/gdbgui/issues/55 中的说明进行操作以及我现在大约一周能找到的大多数相关的 stackoverflow 和 OSXdaily feed。我知道有很多关于此错误的文档,但到目前为止还没有发布这些输出并运行 Catalina。我在 Mac OSX Catalina 10.15.1 上运行 gdb 8.3,配置为“x86_64-apple-darwin19.0.0”

我在系统中创建了证书,然后在登录中创建了证书,结果没有变化。

我在 gdb 和我的主目录中的 .gdbinit 文件中都设置了startup-with-shell off

我最终能够使用 sudo gdb ./a.out 运行 gdb,但当我在 gdb 内使用 r 运行代码时,却收到奇怪的消息:

  1. (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.```
  2. (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.```
  3. 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]```
  4. 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))```

最佳答案

在我的 MacBook Pro(15 英寸,2016 年)上运行 Catalina 10.15.2 (19C57),并启用了 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>

我在系统钥匙串(keychain)上创建了 gdb-cert

为了签署 gdb,我启用了 root 帐户,并且作为 root,我使用了以下命令:

codesign --entitlements gdb.xml -fs gdb-cert/usr/local/Cellar/gdb/8.3.1/bin/gdb

现在我可以使用 netbeans 来调试我的 Fortran 代码。

关于c - 在 Mac OS Catalina 中,所有当前文档均因无法找到进程 ID 的 Mach 任务端口而失败,有什么建议吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59044262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com