Why does the LLDB Debugger constantly fail to attach?

后端 未结 2 1754
夕颜
夕颜 2021-01-01 14:35

I have seen a lot of answers for this question:

error: failed to attach to process ID

as switch to GDB

相关标签:
2条回答
  • 2021-01-01 15:12

    Apple likes to move forward. So setting gdb as the debugger for all new projects is not an option.

    Sometimes, you have to reset the iOS Simulator to clean up the debugger.

    0 讨论(0)
  • 2021-01-01 15:13

    Make sure you have localhost mapped to 127.0.0.1 in your /etc/hosts file:

    $ grep localhost /etc/hosts
    

    If grep doesn't show 127.0.0.1 then add it:

    $ sudo -i
    # echo "127.0.0.1 localhost" >> /etc/hosts
    

    ^ That '#' is root's command prompt; don't type it otherwise you will comment-out the statement and nothing will happen

    NOTE Use >> and not >! (better is to edit it using vi or mate or whatever).

    My /etc/hosts file shows (ignoring comments):

    127.0.0.1       localhost
    255.255.255.255 broadcasthost
    ::1             localhost
    fe80::1%lo0     localhost
    
    0 讨论(0)
提交回复
热议问题