1. download the most recent GDB from https://www.sourceware.org/gdb/download/

  2. expand the gdb-7.12.1.tar.xz file: tar xopf gdb-7.12.1.tar.xz

  3. cd gdb-7.12.1 in terminal to open the gdb folder

  4. then follow the instructions in the README file in the gdb folder, or simply follow the following steps:

  5. ./configure, wait for the terminal

  6. make and wait again (which can take some time)

  7. sudo make install

Now gdb is installed at /usr/local/bin/

Answer from aFactoria on Stack Overflow
๐ŸŒ
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).
Discussions

Does installing GDB on a mac usually take a while? or is it only me?
If I recall, the Mac even lies to you. If you type GCC, it installs CLang and then aliases it to gcc, after forcing you to agree to some ridiculous terms. More on reddit.com
๐ŸŒ r/C_Programming
40
12
April 13, 2024
segmentation fault - how to install gdb on MacBook Air m2 - Stack Overflow
I am getting segmentation fault error in C code so I think the best thing to use to find error would be gdb but gdb is not found. More on stackoverflow.com
๐ŸŒ stackoverflow.com
How do I install GDB on MacOS 10.13.3 (High Sierra) - Stack Overflow
There are tons and tons of post and blogs discussing this topic, but nothing seems to work... From across the internet, here is the common consensus regarding the procedure required to install and... More on stackoverflow.com
๐ŸŒ stackoverflow.com
GCC and GDB on M1 Macs
Hey guys! I was able to build gdb from source just now and documented the steps in the gist below. Gist Hope this helps! More on reddit.com
๐ŸŒ r/mac
22
6
January 23, 2022
๐ŸŒ
GitHub
gist.github.com โ€บ mike-myers-tob โ€บ 9a6013124bad7ff074d3297db2c98247
Steps to get GDB actually working in April 2021 on macOS (Intel x86-64 only) ยท GitHub
@michaelschem im on a 2022 m2 Mac and I get the same error: % brew install gdb gdb: The x86_64 architecture is required for this software. ... Hi I am using macOS Catalina 10.15.7 I had to create the certificate in login as it was showing error while doing it in system. How do i import it to system, please explain. ... # download the script https://github.com/conda-forge/gdb-feedstock/blob/main/recipe/macos-codesign/macos-setup-codesign.sh # replace the certificate name sed -i 's/gdb-codesign/gdb-cert/g' macos-setup-codesign.sh
๐ŸŒ
GNU Project
sourceware.org โ€บ gdb โ€บ download
Download GDB
April 20, 2025 - You can download the most recent official release of GDB from either Project GNU's HTTPS server, or Red Hat's sources site:
๐ŸŒ
Homebrew
formulae.brew.sh โ€บ formula โ€บ gdb
gdb โ€” Homebrew Formulae
brew install gdb ยท GNU debugger ยท https://www.gnu.org/software/gdb/ License: GPL-3.0-or-later ยท Formula JSON API: /api/formula/gdb.json ยท Formula code: gdb.rb on GitHub ยท
๐ŸŒ
MacPorts
ports.macports.org โ€บ port โ€บ gdb
Install gdb on macOS with MacPorts
To install gdb, run the following command in macOS terminal (Applications->Utilities->Terminal)
๐ŸŒ
Reddit
reddit.com โ€บ r/c_programming โ€บ does installing gdb on a mac usually take a while? or is it only me?
r/C_Programming on Reddit: Does installing GDB on a mac usually take a while? or is it only me?
April 13, 2024 - It takes forever for Apple Silicon users unless you install JetBrains CLion and harvest the gdb build from there. It's ridiculous it took all these years to get it. ... Don't buy mac if you want to do anything beyond browsing the web and doing some basic video editing - a big fuckin' waste of money for us, coding apes ....
Find elsewhere
๐ŸŒ
University of Maryland Department of Computer Science
cs.umd.edu โ€บ ~nelson โ€บ classes โ€บ resources โ€บ computer_systems โ€บ gcc_gdb_emacs_in_mac
gcc/gdb/emacs in a Mac
In your Mac, pen a terminal. Install Homebrew (https://brew.sh/). After the Homebrew installation has been completed you can install gcc, gdb, emacs by executing on a Mac terminal:
๐ŸŒ
GNU
gnu.org โ€บ software โ€บ gdb โ€บ gdb.html
GNU Debugger (GDB)
The latest version of GDB, version 10.2, is available for download. This is a minor corrective release over GDB 10.1, fixing the following issues: PR remote/26614 (AddressSanitizer: heap-use-after-free of extended_remote_target in remote_async_inferior_event_handler) PR gdb/26828 (SIGSEGV in follow_die_offset dwarf2/read.c:22950) PR gdb/26861 (internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed. OS: Mac OSX Catalina; Compiler: GCC; Language: C)
๐ŸŒ
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 - Beginning with Mavericks (macOS 10.9) Xcode stopped supporting the gdb debugger. Below are steps to... Tagged with gdb, macos, debug, cpp.
๐ŸŒ
GNU
ftp.gnu.org โ€บ gnu โ€บ gdb
Index of /gnu/gdb
Index of /gnu/gdb ยท Apache/2.4.52 (Trisquel_GNU/Linux) Server at ftp.gnu.org Port 443
๐ŸŒ
GNU
lists.gnu.org โ€บ archive โ€บ html โ€บ info-gnu โ€บ 2018-09 โ€บ msg00001.html
GDB 8.2 released!
* Improved flexibility for loading symbol files. * The 'info proc' command nows works on running processes on FreeBSD systems as well as core files created on FreeBSD systems. * A new --enable-codesign=CERT configure option to automatically codesign GDB after build (useful on MacOS X).