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

前端 未结 10 783
栀梦
栀梦 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 04:46

    I upgraded to gdb 8.3 and was not able to make things working. This helped me:

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

    Where content of gdb.xml is:

    
    
    
    
        com.apple.security.cs.allow-jit
        
        com.apple.security.cs.allow-unsigned-executable-memory
        
        com.apple.security.cs.allow-dyld-environment-variables
        
        com.apple.security.cs.disable-library-validation
        
        com.apple.security.cs.disable-executable-page-protection
        
        com.apple.security.cs.debugger
        
        com.apple.security.get-task-allow
        
    
    
    

    I found this solution here: https://timnash.co.uk/getting-gdb-to-semi-reliably-work-on-mojave-macos/

    Note: Without the entitlement I was able to run gdb only with sudo.

提交回复
热议问题