Search code examples
macosgdbdarwin

GDB frozen on macOS Catalina


I ran a 'helloworld' to try GDB on mac but after typing run it output

[New Thread 0x1903 of process 69034]

and then nothing.

I've waited an hour and still nothing. Having done certification and disable startup-with-shell.

system: MacOS Catalina 10.15.4 GNU gdb (GDB) 9.1


Solution

  • "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)." from https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html

    use lldb instead of gdb in OS X.

    this doesn't solve the problem with gdb, but at least gives you a way to get around it!

    lldb and gdb are very similar debuggers. here's a mapping from gdb commands to their lldb equivalents: https://lldb.llvm.org/use/map.html