GDB errors on macOS Mojave

前端 未结 2 862
挽巷
挽巷 2020-12-07 00:20

Environment: Mac/Mojave and GDB 8.2.1 (via homebrew).

I worked through instructions https://forward-in-code.blogspot.com/2018/11/mojave-vs-gdb.html i.e.:

    <
相关标签:
2条回答
  • 2020-12-07 00:45

    I got gdb working on Mojave by:

    a) getting the latest gdb source archive (at time of writing, ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-8.2.50.20190212.tar.xz) - amongst other things, it adds handling for recognizing executables on Mac.

    b) build gdb. I got errors for variable shadowing in darwin-nat.c so I edited the file and rebuilt (diff https://gist.github.com/joubertnel/267ca0fff4eaad494cc19ec3ba7953ed).

    c) follow steps in https://forward-in-code.blogspot.com/2018/11/mojave-vs-gdb.html

    Voila.

    0 讨论(0)
  • 2020-12-07 00:50

    Unfortunately, the accepted answer doesn't work for me.

    For anyone in the same situation with me, I suggest using Visual Studio Code or Xcode to debug your C program instead.

    0 讨论(0)
提交回复
热议问题