gcc/gdb/emacs in a Mac

Instructions for Installing gcc/gdb/emacs on a Mac

  1. In your Mac, pen a terminal.
  2. Install Homebrew (https://brew.sh/).
  3. After the Homebrew installation has been completed you can install gcc, gdb, emacs by executing on a Mac terminal:
    • brew install gcc
    • brew install gdb
    • brew install emacs
  4. The previous installation will not overwrite the default gcc (clang). 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/.
  5. To detect memory problems you can use the Apple's leaks command. On the terminal you can execute it as follows: leaks --atExit -- a.out. If you would like to install valgrind check https://ports.macports.org/port/valgrind/.

Web Accessibility