Emacs 24 and GDB 6.3 on Mac OS X

百般思念 提交于 2019-12-02 20:53:56

I tried to use the way of modify certification by Keychain.app from

http://sourceware.org/gdb/wiki/BuildingOnDarwin

It still complains about certification..

GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin11.3.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/hanfei/Documents/mis/mis...Reading symbols from /Users/hanfei/Documents/mis/mis.dSYM/Contents/Resources/DWARF/mis...done.
done.
(gdb) r
Starting program: /Users/hanfei/Documents/mis/mis 
Unable to find Mach task port for process-id 52327: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

Then I tried:

$ sudo chgrp procmod /yourpath/gdb
$ sudo chmod g+s /yourpath/gdb

And it works for me now.

I'm using Emacs 24.1 that I built myself on Mac OSX Lion (10.7.4) from the sources in Savannah git. The build is based on the emacs-24.1 tag and have a patch for Lion fullscreen support applied.

Gdb 6.3 works weirdly for me. It complains about the -i=mi flag and it keeps printing a weird timestamp before each command prompt, pushing the (gdb) far to the right and making it really hard to use. Completions don't work as well and there could be other stuff broken that I didn't bother investigating much further.

Using the gdb 7.4 from homebrew/dupes tap, when trying to run gdb from Emacs got the same error described in the link that Firegun mentioned, http://sourceware.org/gdb/wiki/BuildingOnDarwin:

Starting program: /x/y/foo
Unable to find Mach task port for process-id 28885: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))

However, I followed every step described in there to create a certificate and sign gdb and now it runs fine. I start gdb using M-x gdb and then load the app that I want to debug by using the file command. When I type run it prompts for my password to let Developer Tools take control of another process. After giving my password it runs fine. It stops on breakpoints, it follows the code with arrows in the fringe, and if go to the Gud > GDB-MI > Display Other Windows it shows the other windows with info.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!