我使用brew安装gdb失败了。我使用了以下命令:
brew install gdb
gdb是否适用于Mac M1(Apple Silicon)?如果是,我该怎么做?
我使用brew安装gdb失败了。我使用了以下命令:
brew install gdb
gdb是否适用于Mac M1(Apple Silicon)?如果是,我该怎么做?
GDB目前(2022年9月)不支持aarch64架构。参见:
我曾经遇到过同样的问题,我的大学要求使用gdb作为调试器。
我考虑使用虚拟机(一种M1的WSL)并发现了lima。
我安装并配置了Ubuntu虚拟机,然后在其中安装了gdb(apt-get install gdb)。
剩下的问题是配置VS Code以使用已安装在虚拟机上的gdb。为此,我使用了一个名为Remote - SSH的VS Code扩展程序。
通过这个扩展程序,我能够连接到我的虚拟机(本地主机),并像在Linux环境下一样使用VS Code。
希望这可以帮到你。
看起来现在可以使用gdb了。我刚刚通过brew安装了它:
➜ ~ gdb -v
zsh: command not found: gdb
➜ ~ brew install gdb
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
ada-url amber ata chatblade ffmpeg@5
==> New Casks
active-trader-pro reminders-menubar tuist xtool-creative-space
You have 6 outdated formulae installed.
==> Fetching gdb
==> Downloading https://ghcr.io/v2/homebrew/core/gdb/manifests/13.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gdb/blobs/sha256:de9efad28231614ea8281c5e56c0c844634401924fb152f2dd21d578323b3235
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:de9efad28231614ea8281c5e56c0c844634401924fb152f2dd21d578323b3235?se=2023-
######################################################################## 100.0%
==> Pouring gdb--13.1.ventura.bottle.tar.gz
==> Caveats
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:
https://sourceware.org/gdb/wiki/PermissionsDarwin
==> Summary
/usr/local/Cellar/gdb/13.1: 67 files, 30.6MB
==> Running `brew cleanup gdb`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
➜ ~ gdb -v
GNU gdb (GDB) 13.1
Copyright (C) 2023 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.
➜ ~
(Apple M1 Max - Ventura 13.3.1)
gdb:此软件需要x86_64架构。 错误:gdb:未满足此构建的某一要求。
- Joe Gasewiczbrew install gdb gdb: 此软件需要 x86_64 架构。 错误:gdb:未满足要求,构建失败。
- Aryatbz@TBZ-2 ~ % gdb -v
zsh: command not found: gdb
tbz@TBZ-2 ~ % brew install gdb
==> Fetching gdb
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles//gdb-13.2.
######################################################################### 100.0%
==> Pouring gdb-13.2.ventura.bottle.tar.gz
==> Caveats
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:
https://sourceware.org/gdb/wiki/PermissionsDarwin
==> Summary
/usr/local/Cellar/gdb/13.2: 67 files, 30.6MB
==> Running `brew cleanup gdb`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
tbz@TBZ-2 ~ % which brew
/usr/local/Homebrew/bin/brew
tbz@TBZ-2 ~ %
我是一名本科生,水平有限,请多包涵。
重新安装Homebrew到/usr/local,个人参考:https://blog.csdn.net/Le_1M/article/details/122685709
(Apple M1 pro - Ventura 13.4 (22F66))