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
gdb compiler - Apple Community
Visual Studio for Mac mini I am wondering if others in this community have been able to download and install Microsoft Visual Studio Community version that includes C++ in the IDE? 2056 7 ... if you install the Xcode command line tools, you get lldb, which is the debugger that works with the clang compiler install when you use ... gdb ... More on discussions.apple.com
🌐 discussions.apple.com
October 19, 2021
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.
🌐
Quora
quora.com › How-can-I-install-GDB-on-a-Mac
How to install GDB on a Mac - Quora
Answer (1 of 7): The question is “How can I install GDB on a Mac?” I’ve never tried - but if you’re using Xcode or the “command line development tools” on the Mac from Apple and want to use a command line debugger, then use “lldb” instead (llvm/clang seems to be the native compiler.)
🌐
GNU Project
sourceware.org › gdb
GDB: The GNU Project Debugger
Those programs might be executing on the same machine as GDB (native), on another machine (remote), or on a simulator. GDB can run on most popular UNIX and Microsoft Windows variants, as well as on macOS. GDB supports the following languages (in alphabetical order): ... Version 16.3 of GDB, the GNU Debugger, is now available for download.
🌐
Apple Community
discussions.apple.com › thread › 253272158
gdb compiler - Apple Community
October 19, 2021 - If you want clang, Apple provides an installable version of that as the command line tools, or provides that as part of the Xcode download. The Apple downloads include the lldb debugger. ... Failing that, check with whoever is maintaining that gdb homebrew recipe.