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).
🌐
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)
🌐
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 ·
🌐
GNU Project
sourceware.org › gdb › download
Download GDB
You can download the most recent official release of GDB from either Project GNU's HTTPS server, or Red Hat's sources site:
🌐
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.)
🌐
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
Find elsewhere
🌐
GitHub
gist.github.com › danisfermi › 17d6c0078a2fd4c6ee818c954d2de13c
Setup gdb on Mac OS Sierra/High Sierra · GitHub
Tried that and got: `... N2-MacBook-Pro:~ n2$ codesign -fs gdbc /usr/local/bin/gdb · gdbc: no identity found ...` All help gratefully appreciated. ... @Nexus21 if you named the certificate in step 3 as gdbcert the command should be codesign -fs gdbcert /usr/local/bin/gdb ... \"/Users/theobouwman/Downloads...
🌐
Lazarus
forum.lazarus.freepascal.org › index.php
Installing GDB on MAC OS X
Installing GDB on MAC OS X · Free Pascal · Website · Downloads · Wiki · Documentation · Bugtracker · Mailing List · Lazarus · Website · Downloads (Laz+FPC) Packages (OPM) FAQ · Wiki · Documentation (RTL/FCL/LCL) Bugtracker · CCR Bugs · GIT · Mailing List ·
🌐
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.
🌐
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 - First, let’s create a new disk image for our virtual machine (VM). Open your Terminal and enter the following command:bashCopy code ... This command creates a new disk image named gdb.img with a size of 10GB. Next, you’ll need to download the Ubuntu Server ISO file.
🌐
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.
🌐
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
GDB: The GNU Project Debugger
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)
🌐
Apple Community
discussions.apple.com › thread › 253272158
gdb compiler - Apple Community
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.
🌐
Medium
thomaskov.medium.com › gdb-debugger-for-macos-5cb7751dc0a9
gdb Debugger for macOS. This guide will walk you through the… | by Thomas Chou | Medium
June 30, 2021 - gdb Debugger for macOS This guide will walk you through the steps of installing the gdb debugger on a macOS machine and having it run properly. Also, this tutorial works for Big Sur 11.4 and it might …
🌐
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 ....