macos下默认的调试工具是lldb

遇到个问题:我在看ostep的14章,做homework,需要使用gdb进行调试,但是macos没有gdb,我想既然如此直接一键三连安装个gdb不就完事了:

HOMEBREW_NO_AUTO_UPDATE=1 brew install gdb

然而直接就报错了:

$ HOMEBREW_NO_AUTO_UPDATE=1 brew install gdb
==> Downloading https://homebrew.bintray.com/bottles/gdb-10.1.big_sur.bottle.tar
#=#=-#  #
curl: (22) The requested URL returned error: 403 Forbidden
Error: Failed to download resource "gdb"
Download failed: https://homebrew.bintray.com/bottles/gdb-10.1.big_sur.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://ftp.gnu.org/gnu/gdb/gdb-10.1.tar.xz
Already downloaded: /Users/itsc/Library/Caches/Homebrew/downloads/d6dfd55ca620ab89b3209b96be8cac6a9b85c636faf527f4c5e4bc7e7ff07cee--gdb-10.1.tar.xz
Error: Your Xcode (12.0 => /Users/itsc/Downloads/Xcode.app/Contents/Developer) is too outdated.
Please update to Xcode 12.2 (or delete it).
Xcode can be updated from the App Store.

这是让我去更新xcode,我去App Store上一看,好家伙11GB,我不就是想用个gdb吗。
发现mac上的调试工具是lldb,似乎可以直接使用,先将就使用。

lldb ./a.out
posted @ 2021-08-15 20:47  ssh_alitheia  阅读(296)  评论(0编辑  收藏  举报