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
For each of them, open the Debugger tab, set the GDB debugger field to the same path /usr/local/bin/gdb, and click the Apply button. After repeating this change for all listed projects, click Close. ... If the above steps do not solve the issue on your machine, or you encounter a problem while ...
🌐
GitHub
gist.github.com › mike-myers-tob › 9a6013124bad7ff074d3297db2c98247
Steps to get GDB actually working in April 2021 on macOS (Intel x86-64 only) · GitHub
These open issues may also help: gdb start two threads and the former has to be sent SIGINT(Ctrl + C) domq/homebrew-gdb#3 · (Edit: and yeah i know that apple and homebrew dropped macos 11 support a long long time ago, but I don't have any alternative devices at the moment and it would be fine if i could launch gdb debugger on my old macos.)
🌐
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) ... The MacPorts Project uses a system called Trac to file tickets to report bugs and enhancement requests.
🌐
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 - At this point you should be able to successfully debug your programs on Mac using gdb. Do a test by running (for example): ... Breakpoint 1 at 0x100000de5: file hello_word.c, line 15. I hope you're seeing the results you expected! Leave a comment and let me know how it goes! ... Security@Cloudflare. Hacker with CPTC & WRCCDC. Building tools to help others learn about security. Hack the planet. ... Or you can use lldb instead!
🌐
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.)
Find elsewhere
🌐
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. Don’t worry, though! There’s a workaround using QEMU, a machine emulator and virtualizer. Here’s a simplified guide on how to set up a virtual environment to run GDB.
🌐
Apple Community
discussions.apple.com › thread › 253272158
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 is usually a debugger.
🌐
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
You will fing GNU gcc at /usr/local/bin and the name will be something like gcc-14. You can run gdb and emacs by just typing gdb and emacs, respectively. The installed emacs version does not have a GUI. If you would like a GUI version, install the emacs app available at https://emacsformacosx.com/. ...
🌐
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 - 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 not work for later versions. We will be using brew to install gdb. If you haven’t installed it, check out here.
🌐
YouTube
youtube.com › watch
How to install gdb on MacOS terminal Sierra - YouTube
macos: How to install gdb on MacOS terminal SierraThanks for taking the time to learn more. In this video I'll go through your question, provide various answ...
Published   April 4, 2023
🌐
GitHub
gist.github.com › danisfermi › 17d6c0078a2fd4c6ee818c954d2de13c
Setup gdb on Mac OS Sierra/High Sierra · GitHub
Go up to Edit > Enable Root User. Codesign gdb using your certificate: codesign -fs gdbc /usr/local/bin/gdb · Shut down your mac and restart in recovery mode (hold down command-R until apple logo appears) ... Reboot your Mac. Debugging with gdb should now work as expected. ... Stil not work here. Get error: During startup program terminated with signal SIGTRAP, Trace/breakpoint trap. ... GDB 8.1 is broken on macOS 10.13.
🌐
Cohost
cohost.org › sdave-b › post › 1560910-how-to-get-gdb-to-wo
cohost! - "How to get GDB to work on macOS Ventura"
May 26, 2023 - In the Keychain Access application, find gdb-cert in the System keychain, and right-click > 'Get Info' Expand the trust panel on the info form, and set "When Using this Certificate" to "Always Trust" This step tells macOS what questionable security authorizations the signed GDB binary will require to do its job.
🌐
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 - Probably only by manual compiling. Otherwise, use lldb of the default tools… however, other IDEs do not seem to all be ready to operate with it Continue this thread Continue this thread ... Thanks for the info. I am using LLDB. It is working well! ... 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 ....
🌐
Thomas Vitale
thomasvitale.com › how-to-setup-gdb-and-eclipse-to-debug-c-files-on-macos-sierra
How to setup gdb and Eclipse to debug C++ files on macOS Catalina
January 6, 2020 - If you are on macOS Sierra (10.12) or later, you need to do this extra step. In the home directory, create a new file called .gdbinit and write the following command in it: ... Now you can use gdb for debugging files on your Mac.