Homebrew GDB can't open core file on Yosemite 10.10

帅比萌擦擦* 提交于 2019-11-30 05:22:07

Based on the long GDB developers' discussion thread on this issue, it seems Apple did not merge their changes back to the official GNU mainline, and instead chose to publish the modified source code on their own site. As a result, the Homebrew GDB install (which uses the stock GDB sources) can't load OS X core files.

At this point, I see three choices:

  1. Give in and learn LLDB. There's a GDB to LLDB cheat sheet to help.

  2. Install Apple's custom GDB from MacPorts. I've long forsaken MacPorts, so I can't test it, but if you have MacPorts installed, try the following:

    $ sudo port install gdb-apple
    $ codesign -s <your_GDB_cert_id> /opt/local/bin/gdb-apple
    $ /opt/local/bin/gdb-apple ./list_test /cores/core.1176
    
  3. Translate MacPorts' GDB patches and build spec into a Homebrew formula. It's theoretically possible, but I don't have the time to do it myself.

Personally, I've opted to just learn LLDB. Apple has moved permanently to LLVM, so it's probably just a matter of time before the old patched GDB stops working with the latest-and-greatest Xcode tools.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!