我在模拟器上测试我的应用时得到了这条消息:
来自调试器的消息:对k数据包有意外响应:确定
这是什么意思,是我的应用程序在任何危险中?
使用Xcode 6.4& 7.2
答案 0 :(得分:4)
如果查看llvm源代码中的文件ProcessGDBRemote.cpp,您会看到当Xcode的调试器进程发出意外响应时会发生这种情况,在这种情况下,如果数据包不是{{1} }或'W'
字符:
'X'
在这种情况下,调试器正在发送字符串Error
ProcessGDBRemote::DoDestroy ()
{
// ...
if (m_gdb_comm.SendPacketAndWaitForResponse("k", 1, response, send_async) == GDBRemoteCommunication::PacketResult::Success)
{
char packet_cmd = response.GetChar(0);
if (packet_cmd == 'W' || packet_cmd == 'X')
{
// ...
}
else
{
if (log)
log->Printf ("ProcessGDBRemote::DoDestroy - got unexpected response to k packet: %s", response.GetStringRef().c_str());
exit_string.assign("got unexpected response to k packet: ");
exit_string.append(response.GetStringRef());
}
// ...
SetExitStatus(exit_status, exit_string.c_str());
StopAsyncThread ();
KillDebugserverProcess ();
return error;
}
而不是"OK"
或"W"
。你无能为力,Xcode背后有一个问题。我发现在重新连接到调试会话之前杀死Xcode的调试进程,重新启动Xcode以及重新启动计算机的组合可以解决这个问题。
要了解有关OS X上本机进程的更多信息,请查看嵌套"X"
语句中的注释:
if
有关可能发生此错误的原因的有用评论:
// For Native processes on Mac OS X, we launch through the Host Platform, then hand the process off // to debugserver, which becomes the parent process through "PT_ATTACH". Then when we go to kill // the process on Mac OS X we call ptrace(PT_KILL) to kill it, then we call waitpid which returns // with no error and the correct status. But amusingly enough that doesn't seem to actually reap // the process, but instead it is left around as a Zombie. Probably the kernel is in the process of // switching ownership back to lldb which was the original parent, and gets confused in the handoff. // Anyway, so call waitpid here to finally reap it.
答案 1 :(得分:2)
这是Xcode“表演”。我也得到了一次并通过在终端中运行它来修复它:
rm -rf ~/Library/Developer/Xcode/DerivedData/* ~/Library/Caches/com.apple.dt.Xcode/*
基本上清除了有时会损坏的Xcode缓存和派生数据。希望对你有效。