繁体   English   中英

如何在OSX 10.9上安装gdb

[英]How to install gdb on OSX 10.9

如何在OSX 10.9上安装gdb?

我尝试使用macports:

port install gdb
Password:
...
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

但是我没有gdb可执行文件:

$ which gdb
$ 

发现 Mac上的macports gdb叫做ggdb。 所以我建立了一个链接:

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) 

那么如何在OSX 10.9上正确安装gdb呢?

PS相关问题,但没有帮助:

如何在OSX上获得“codesigned”gdb?

“请检查gdb是否为codesigned - 请参阅taskgated(8)” - 如何使用自制程序代码签名安装gdb?

我这样做了( 这里描述):

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

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

  2. 重启电脑。

  3. 使用gdb

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM