5
Codesign gdb on OSX · GitHub
source link: https://gist.github.com/hlissner/898b7dfc0a3b63824a70e15cd0180154
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Codesign gdb on OSX · GitHub
Codesign gdb on OSX
Note: these instructions are for pre-Sierra MacOS. Sierra (10.12) and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow
If you are getting this in gdb on OSX while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
- Open Keychain Access
- In the menu, open Keychain Access > Certificate Assistant > Create a certificate
- Give it a name (e.g.
gdbc
)- Identity type: Self Signed Root
- Certificate type: Code Signing
- Check: let me override defaults
- Continue until it prompts you for: "specify a location for..."
- Set Keychain location to System
- Create a certificate and close assistant.
- Find the certificate in System keychains, right click it > get info (or just double click it)
- Expand Trust, set Code signing to
always trust
- Restart taskgated in terminal:
killall taskgated
- Enable root account:
- Open System Preferences
- Go to User & Groups > Unlock
- Login Options > "Join" (next to Network Account Server)
- Click "Open Directory Utility"
- Go up to Edit > Enable Root User
- Run
codesign -fs gdbc /usr/local/bin/gdb
in terminal: this asks for the root password - Disable root account (see #10)
Done!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK