GDB kind of doesn't work on macOS Sierra

前端 未结 8 774
梦毁少年i
梦毁少年i 2020-12-02 07:55

It is a problem that appeared when I first updated to macOS Sierra yesterday.

GDB itself is running OK. However, somehow, it cannot run my program. When I type \'run

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 08:28

    I got the same error after updating to macOS Sierra. Temporarily I changed debugger to LLDB using the library lldbmi2:
    1. git clone https://github.com/freedib/lldbmi2.git lldbmi2
    2. cd lldbmi2
    3. mkdir build
    4. cd build
    5. cmake ../
    6. make
    7. sudo make install

    Once lldbmi2 is installed, you can debug your application by creating a new C/C++ Application in Debug Configurations... and change the GDB debugger (in Debugger tab) from gdb to lldbmi2. Options to lldbmi2 may be set there. Something like /usr/local/bin/lldbmi2 --log.

    Everything seems to be working fine, and even better as GDB.

提交回复
热议问题