0

I am trying to get gdb (installed via homebrew) to run on OS/X El Capitan. I have gone through multiple posts online about code signing, creating a certificate, etc., but it still does not work.

(See for example: How to get a "codesigned" gdb on OSX? )

My code is properly signed as evidenced by:

codesign -vvd /usr/local/bin/gdb
Executable=/usr/local/Cellar/gdb/7.11/bin/gdb
Identifier=org.gnu.gdb
Format=Mach-O thin (x86_64)
CodeDirectory v=20100 size=44540 flags=0x0(none) hashes=1388+2 location=embedded
Signature size=1772
Authority=gdb-cert
Signed Time=Jul 4, 2016, 7:37:55 AM
Info.plist entries=4
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=1 size=88

and also

codesign -vvd /usr/local/Cellar/gdb/7.11/bin/gdb 
Executable=/usr/local/Cellar/gdb/7.11/bin/gdb
Identifier=org.gnu.gdb
Format=Mach-O thin (x86_64)
CodeDirectory v=20100 size=44540 flags=0x0(none) hashes=1388+2 location=embedded
Signature size=1772
Authority=gdb-cert
Signed Time=Jul 4, 2016, 7:37:55 AM
Info.plist entries=4
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=1 size=88

And my user is a member of both _developer and procmod which I read might be important.

But all to no avail. When I try to debug my program I still get an error:

gdb a.out
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
...
Reading symbols from a.out...(no debugging symbols found)...done.
(gdb) run
Starting program: a.out 
Unable to find Mach task port for process-id 658: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
(gdb)

I even tried sudo spctl --master-disable to turn off the check for signed coded altogether and I still get the same error.

However, if I run as root then it works.

I would really like to be able to run gdb as a normal user. Does anyone have an idea what is going on?

Community
  • 1
  • 1
G. P. Morton
  • 121
  • 1
  • 4
  • Not the answer you're looking for, but I suggest you learn to love lldb instead. – Paul R Jul 04 '16 at 13:35
  • I would use lldb but i can't get it to run properly inside of emacs. I finally got gud.el to work sort of -- but it puts the code and debugger output in one window, instead of two with gdb. I also can't see the program output anywhere. What sort of gui do you use ontop of lldb? – G. P. Morton Jul 04 '16 at 15:12
  • Ah - that explains your motivation then. I typically use Xcode for most OS X development, and occasionally debug from the command line, but I don't use emacs on OS X. – Paul R Jul 04 '16 at 16:01

0 Answers0