gdb is not supported on M1 Macs; you can instead consider using lldb.

Answer from 284751067qqcom on Stack Overflow
🌐
GitHub
github.com › orgs › Homebrew › discussions › 1114
Support for gdb on m1? · Homebrew · Discussion #1114
Yes it is installable using brew install gdb, but still you can't debug native Mach-O binaries. GDB never worked good with Mach-O.
🌐
Apple Community
discussions.apple.com › thread › 253272158
gdb compiler - Apple Community
Want to know how to install TubroC++ ... tools, you get lldb, which is the debugger that works with the clang compiler install when you use ... gdb is usually a debugger....
🌐
GitHub
github.com › ares-emulator › ares › issues › 1408
On Apple Silicon (Mac M1). gdb cannot be built. What are my debugging options? · Issue #1408 · ares-emulator/ares
February 26, 2024 - I am running Ares on my Apple Silicon MacBook Pro. While Ares can connect to GDB, I cannot build GDB on Apple Silicon as it does not support the architecture. What are my options? Can Ares connect ...
Published   Feb 26, 2024
🌐
GitHub
gist.github.com › mike-myers-tob › 9a6013124bad7ff074d3297db2c98247
Steps to get GDB actually working in April 2021 on macOS (Intel x86-64 only) · GitHub
@mike-myers-tob thank you for this write up! I also confirm that above approach works with Eclipse 2022-03 (4.23.0) and GNU gdb (GDB) 12.1 installed from brew install gdb ... The hint is in the error x86_64 architecture is required for this software., you're on an M1 mac.
🌐
GitHub
gist.github.com › securisec › b88cf9e89f957669b95043c9c380a26e
gdb debugging on ARM/m1 mac with docker · GitHub
docker run --rm -it -v $PWD:/data --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --platform=linux/amd64 securisec/gdb /bin/bash
🌐
Stenger
stenger.io › blog › fast-gdb
Fast x86 Debugging: Using GDB On Apple Silicon with Rosetta emulation
This blog post will outline how to setup x86 GDB on M1. This isn’t your run-of-the mill x86 emulation - this is FAST — using the Rosetta translation engine, instead of QEMU. Thanks to sporks.space for the initial writeup of the ROSETTA_DEBUGSERVER feature! I am running on a M1 Chip, running MacOS Sonoma 14.0 (Build 23A339).
Find elsewhere
🌐
Homebrew
formulae.brew.sh › formula › gdb
gdb — Homebrew Formulae
https://www.gnu.org/software/gdb/ · License: GPL-3.0-or-later
🌐
Medium
medium.com › @AI_and_Blockchain › how-to-get-gdb-running-on-macos-with-arm-chips-using-qemu-ff9041d6f380
How to Get GDB Running on macOS with ARM Chips Using QEMU | by AI_and_Blockchain | Medium
December 13, 2023 - Unfortunately, GDB doesn’t run natively on macOS with these chips, and LLDB, the default debugger on macOS, doesn’t support the 32-bit RISC-V architecture.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › hardware and peripherals › raspberry pi pico › sdk
GDB on Mackbook Air M1 -- impossible? - Raspberry Pi Forums
(base) ➜ brew install gdb ==> Downloading https://formulae.brew.sh/api/formula.json ######################################################################## 100.0% ==> Downloading https://formulae.brew.sh/api/cask.json #=#=# gdb: The x86_64 architecture is required for this software. Error: gdb: An unsatisfied requirement failed this build. Does this means that there would be no SWD debug for PICO on Mackbook M1 Air?
🌐
DEV Community
dev.to › jasonelwood › setup-gdb-on-macos-in-2020-489k
Install Gdb Mac: Setup gdb on macOS in 2020 - DEV Community
September 18, 2020 - If you tried debugging with gdb now, you would likely receive a "No symbol table is loaded" error. In order to solve this, you'll need to compile programs with the -ggdb option, as in the following example: ... At this point you should be able to successfully debug your programs on Mac using gdb.
🌐
UCI ICS
ics.uci.edu › ~pattis › common › handouts › macmingweclipse › allexperimental › mac-gdb-install.html
ICS 46: GDB Installation on Mac OS X
The problem is caused by Apple switching away from GDB, the GNU debugger, to LLDB, the LLVM debugger, in their Xcode toolchain (along with the transition from GCC to Clang). Unfortunately, Eclipse is not capable of communicating with any debugger other than GDB (yet).
🌐
Docker Community
forums.docker.com › docker hub
Debugging with GDB on linux/amd64 docker on Mac m1 host - Docker Hub - Docker Community Forums
November 24, 2021 - Hello, I am using a Mac M1. Mac book pro (laptop). I am using Docker to run linux/amd64. ubuntu:bionic. I am unable to set break points in the code compiled in the container The repro steps are here docker pull u…
🌐
Tweaking4All
tweaking4all.com › forums › software developmen... › delphi, lazarus, fr...
macOS - Install GDB in 2023 (for use with Lazarus Pascal)
August 2, 2021 - Especially for Apple Silicon Mac's you'd probably want to use LLDB as it seems GDB does not [yet] support Apple Silicon.
🌐
Apple Community
discussions.apple.com › thread › 252587810
Any C/C++ debugger available for m1 right… - Apple Community
On Homebrew website it doesn't show an option for gdb for Apple Silicon. So is there a C++ debugger for m1 yet? ... Had you installed Xcode 12.4 and/or the command-line tools for Xcode 12.4, you would have the clang/clang++ compiler, and the lldb debugger that would either allow you to debug visually (Xcode) or in the Terminal. These tools support arm64 builds and debugging. See Apple's Debugging tools. ... how to do C++ on M1 macbook I want to write some C++ programs on this Macbook M1 chip model but the thing is it does not work mainly because most of the apps such as VisualStudio are being emulated?
🌐
GitHub
gist.github.com › m0sys › 711d0ec5e52102c6ba44451caf38bd38
Apple M1 ARM GDB Build from Source with Python Support · GitHub
The latest information appears to be in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96168 - it links to a fork which has support for macOS on aarch64, but I didn't try it yet. ... Hey guys, I apologize for late response! This script that I posted only works for arm-none-eabi. I haven't personally tried to compile gdb for aarch64 since its not supported.
🌐
MacPorts
ports.macports.org › port › gdb-apple
Install gdb-apple on macOS with MacPorts
GDB can run on most popular UNIX and Microsoft Windows variants. ... If not done already, install MacPorts.
🌐
GNU
lists.nongnu.org › archive › html › directory-discuss › 2022-03 › msg00000.html
Re: Gdb debugger issue on M1 Mac
Hi, I think it is about SIP (System ... M1 Mac. I could successfully install Ubuntu (linux/amd64). > Then I installed C and C++. Everything went well. Then I wrote a > simple C code ‘Hello World’. It generated the result. But when I tried > to run GNU’s gdb debugger, ...