GNU GDB

QA:

gdb run : unable to find mach task port for process-id on catalina

1.3. Sign and entitle the gdb binary

  1. Create a gdb-entitlement.xml file containing the following:

    <?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>
  2. If the certificate you generated in the previous section is known as gdb-cert, use:

    codesign --entitlements gdb-entitlement.xml -fs gdb-cert $(which gdb)

💡 You may have to prepend this command with sudo if the gdb binary is located in a place that is not writable by regular users.

 

https://opensource.apple.com/source/lldb/lldb-69/docs/code-signing.txt

https://sourceware.org/gdb/wiki/PermissionsDarwin

posted @ 2021-08-31 16:45  anyboo  阅读(43)  评论(0编辑  收藏  举报