如何在OSX 10.9上安装gdb [英] How to install gdb on OSX 10.9
问题描述
如何在OSX 10.9上安装gdb?
我尝试使用macports:
port安装gdb
密码:
...
--->更新二进制数据库:100.0%
--->扫描链接错误的二进制文件:100.0%
--->没有发现破损的文件。
但我没有gdb可执行文件:
$ which gdb
$
I 发现 Mac上的macports gdb名为ggdb。所以我建立了一个链接:
pre $
sudo ln -s / opt / local / bin / ggdb / opt / local / bin / gdb
$ gdb --args ./prog -time
GNU gdb(GDB)7.6
版权所有(C)2013自由软件基金会,Inc.
许可证GPLv3 +: GNU GPL版本3或更高版本< http://gnu.org/licenses/gpl.html>
这是免费软件:您可以自由更改和重新分配它。
在法律允许的范围内,不存在任何担保。有关详细信息,请键入显示复制
和显示保修。
此GDB被配置为x86_64-apple-darwin13.0.0。
有关错误报告的说明,请参阅:
< http://www.gnu.org/software/gdb/bugs/> ...
读取/ prog中的符号。 .done。
(gdb)r
启动程序:/ prog -time
无法为进程ID 65740找到Mach任务端口:(os / kern)failure(0x5)。
(请检查gdb是否已签名 - 请参阅taskgated(8))
(gdb)
那么如何在OSX 10.9上正确安装gdb?
PS相关问题,这并没有帮助:
请检查gdb是否为signedigned - 请参阅taskgated(8)。 - 如何使用自签代码签名来安装gdb?
我这样做了(描述 here ):
-
sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist
在第22行,第27行将选项字符串从
-s
更改为-sp
。 -
重新启动电脑。
-
使用gdb
How to install gdb on OSX 10.9?
I try to use macports:
port install gdb
Password:
...
---> Updating database of binaries: 100.0%
---> Scanning binaries for linking errors: 100.0%
---> No broken files found.
But I don't have gdb executable:
$ which gdb
$
I found out that macports gdb on mac is called ggdb. So I make a link:
sudo ln -s /opt/local/bin/ggdb /opt/local/bin/gdb
$ gdb --args ./prog -time
GNU gdb (GDB) 7.6
Copyright (C) 2013 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-darwin13.0.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /prog...done.
(gdb) r
Starting program: /prog -time
Unable to find Mach task port for process-id 65740: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
(gdb)
So how to install gdb correctly on OSX 10.9?
P.S. Related questions, which doesn't help:
How to get a "codesigned" gdb on OSX?
I made it this way (described here):
sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist
change option string from
-s
to-sp
at line 22, col 27.reboot the computer.
Use gdb
这篇关于如何在OSX 10.9上安装gdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!