“please check gdb is codesigned - see taskgated(8)” - How to get gdb installed with homebrew code signed?

前端 未结 10 789
栀梦
栀梦 2020-12-02 04:20

I\'m under osx 10.8.4 and have installed gdb 7.5.1 with homebrew (motivation get a new gdb with new features such as --with-python etc... )

Long story short when I

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 05:07

    None of this worked for me and I had to go with a long run. Here is a full list of steps I've done to get it working.

    1. Create a certificate to sign the gdb.

    Unfortunately, system certificate gave me Unknown Error = -2,147,414,007 which is very helpful, so I had to go with a workaround. KeyChain Assistant -> Create certificate ->

    Pick login, gdb-cert, Code Signing

    Copy/move certificate to the System keychain (enter password)

    1. Select certificate (gdb-cert) click Get info -> Trust Always
    2. Disable startup-with-shell

    Enter in console: set startup-with-shell off

    Remember configuration: echo "set startup-with-shell off" >> ~/. gdbinit

    1. Enable Root User

    Go to System Preferences -> Users & Groups -> Unlock it -> Login Options -> Network Account Server -> Join -> Unlock it -> Edit (menu) -> Enable Root User

    1. sudo killall taskgated
    2. Finally sign gdb

    codesign -fs gdb-cert "$(which gdb)"

    1. Disable Root User (Step 4)
    2. Reboot if still does not work. (if nothing else works, most likely it works already)

    PS. I end up using lldb because it just works (tutorial)

提交回复
热议问题