DEV Community

ksheroz
ksheroz

Posted on

Debugging C/C++ on M1 Macs

Background

Recently I had to debug a project written in C but this time round I was using my new M1 Mac and turns out the old familiar GDB Debugger is not available on it. I had to dig deep to find a solution and I'm writing this article so you don't have to do the same.

Solution

You can either use some fancy ways to make GDB working on M1 or a simpler and recommended solution is to use lldb instead of gdb. lldb is similar than gdb and supported on M1 Macs. It's commands are also similar to gdb so you wont have much issues.

Here's the documentation for it:
Documentation

Top comments (0)