【问题标题】:How to install gdb on OSX 10.9如何在 OSX 10.9 上安装 gdb
【发布时间】:2013-11-30 02:16:21
【问题描述】:

如何在 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
$ 

found out那个macports gdb on mac叫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?

附:相关问题,无济于事:

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?

【问题讨论】:

    标签: macos gdb installation


    【解决方案1】:

    我是这样做的(描述为here):

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

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

    2. 重启电脑。

    3. 使用 gdb

    【讨论】:

    • 顺便说一句。无需重启,你可以简单地杀死taskgated。 (你甚至可以通过活动监视器来完成)
    猜你喜欢
    • 2014-08-23
    • 2014-04-12
    • 1970-01-01
    • 2014-05-28
    • 2014-04-24
    • 1970-01-01
    • 2014-06-19
    • 2014-04-22
    • 2018-03-19
    相关资源
    最近更新 更多