Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何在OSX 10.9上安装gdb_Macos_Gdb_Installation - Fatal编程技术网

Macos 如何在OSX 10.9上安装gdb

Macos 如何在OSX 10.9上安装gdb,macos,gdb,installation,Macos,Gdb,Installation,如何在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称为

如何在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) 
sudo ln-s/opt/local/bin/ggdb/opt/local/bin/gdb
$gdb—参数。/prog—时间
GNU gdb(gdb)7.6
版权所有(C)2013免费软件基金会。
许可证GPLv3+:GNU GPL版本3或更高版本
这是自由软件:您可以自由更改和重新发布它。
在法律允许的范围内,不存在任何担保。键入“显示复制”
和“显示保修”了解详细信息。
此GDB配置为“x86_64-apple-darwin13.0.0”。
有关错误报告说明,请参阅:
...
从/prog…读取符号已完成。
(gdb)r
启动程序:/prog-时间
找不到进程id 65740的Mach任务端口:(os/kern)故障(0x5)。
(请检查gdb是否进行了代码签名-请参阅taskgated(8))
(gdb)
那么,如何在OSX 10.9上正确安装gdb呢

p.S.相关问题,但这无助于:

我是这样做的(描述):

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

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

  • 重新启动计算机

  • 使用gdb


  • 顺便说一句,无需重新启动,只需杀死
    taskgated
    。(您甚至可以通过活动监视器进行此操作)