如何在OSX 10.9上安装gdb [英] How to install gdb on OSX 10.9

查看:146
本文介绍了如何在OSX 10.9上安装gdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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 on OSX?



请检查gdb是否为signedigned - 请参阅taskgated(8)。 - 如何使用自签代码签名来安装gdb?

解决方案

我这样做了(描述 here ):



  1. sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist

    在第22行,第27行将选项字符串从 -s 更改为 -sp


  2. 重新启动电脑。


  3. 使用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?

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

解决方案

I made it this way (described here):

  1. sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist

    change option string from -s to -sp at line 22, col 27.

  2. reboot the computer.

  3. Use gdb

这篇关于如何在OSX 10.9上安装gdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆