为什么LLDB调试器不断附加? [英] Why does the LLDB Debugger constantly fail to attach?
问题描述
我已经看到很多关于这个问题的答案:
错误:无法附加到进程ID
as 切换到GDB
。但是没有人解释为什么发生的原因
GDB调试器的附件工作正常,但默认和推荐的项目设置是LLDB。
任何人都可以解释为什么LLDB失败?这是一个常见的错误还是我做错了?
或者,如何在创建新项目时将GDB设置为默认调试器,而不需要手动更改? p>
系统信息:
操作系统:Lion
RAM:5GB
XCode:版本4.6(4H127)
设备:Mac mini
我的本地主机设置:
确保您的 localhost
映射到 127.0.0.1
code> / etc / hosts 文件:
$ grep localhost / etc / hosts
如果 grep
不显示 127.0.0.1
然后添加它:
$ sudo -i
#echo127.0.0.1 localhost>> / etc / hosts
^#是root的命令提示符;不要输入,否则你会注释掉声明,没有什么会发生
注意使用>>
而不是>
! (更好的是使用 vi
或 mate
或其他任何内容进行编辑。
我的 / etc / hosts
文件显示(忽略注释):
127.0.0.1 localhost
255.255.255.255 broadcasthost
:: 1 localhost
fe80 :: 1%lo0 localhost
I have seen a lot of answers for this question:
error: failed to attach to process ID
as switch to GDB
. But no one addresses the reason of why it happens?
Attaching works fine with the GDB debugger but the default and recommended project setting is LLDB.
Can anybody explain why LLDB fails? Is it a common bug or am I doing something wrong?
Alternatively, how can I set GDB as my default debugger without changing it manually when creating the new projects?
System Info:
OS: Lion
RAM: 5GB
XCode: Version 4.6 (4H127)
Device: Mac mini
My localhost setting:
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
这篇关于为什么LLDB调试器不断附加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!