Ios Xcode";来自调试器的消息:收到对k数据包的意外响应:OK“;

Ios Xcode";来自调试器的消息:收到对k数据包的意外响应:OK“;,ios,xcode,llvm,xcode6.4,xcode7.2,Ios,Xcode,Llvm,Xcode6.4,Xcode7.2,我在模拟器上测试我的应用程序时收到以下消息: 来自调试器的消息:收到对k数据包的意外响应:确定 这意味着什么?我的应用程序是否有任何危险 使用Xcode 6.4和7.2,它的Xcode“运行正常”。我也得到过一次,并通过在终端中运行以下命令修复了它: rm -rf ~/Library/Developer/Xcode/DerivedData/* ~/Library/Caches/com.apple.dt.Xcode/* 基本上清除Xcode缓存和有时会损坏的派生数据。希望对你有用 如果查看llv

我在模拟器上测试我的应用程序时收到以下消息:

来自调试器的消息:收到对k数据包的意外响应:确定

这意味着什么?我的应用程序是否有任何危险

使用Xcode 6.4和7.2,它的Xcode“运行正常”。我也得到过一次,并通过在终端中运行以下命令修复了它:

rm -rf ~/Library/Developer/Xcode/DerivedData/* ~/Library/Caches/com.apple.dt.Xcode/*
基本上清除Xcode缓存和有时会损坏的派生数据。希望对你有用

如果查看llvm源代码中的文件,您将看到当Xcode的调试器进程出现意外响应时会发生这种情况,在这种情况下,如果数据包不是
'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”
“X”
。你无能为力,Xcode的幕后有个问题。我发现,在重新连接到调试会话之前,关闭Xcode的调试进程、重新启动Xcode以及重新启动计算机,这些组合可以解决这个问题

要了解有关OS X上本机进程的更多信息,请签出嵌套的
if
语句中的注释:

有关可能发生此错误的原因的有用评论:


我们应该猜猜你的代码在做什么吗?显示负责的相关零件。此处相同。即使调试会话尚未启动,也会显示此消息。我猜,是苹果悄悄地强迫我们使用新的xCode 7。上个月调试期间xCode的一些崩溃变得频繁。。。现在这条消息。我也收到了那个错误。还有人使用真实的设备而不是模拟器吗?直到今天我才看到它,我用的是一个真正的设备。我拔下了我的设备(我不记得项目是否还在运行)。过了一会儿,我在控制台中发现了这个错误。。有趣的是,我的xcode-7也没有调用函数。这是一个简单的函数调用。调试器一直到函数调用点,但从未调用它,控制台中会弹出k数据包错误。它不会崩溃或发生任何事情。。代码在不调用函数的情况下继续运行。如果再次发生这种情况,我将尝试此操作。你知道什么是
k包吗?@noobsmggoobs是的,我也想知道那是什么。
// 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.
// There is a bug in older iOS debugservers where they don't shut down the process
// they are debugging properly.  If the process is sitting at a breakpoint or an exception,
// this can cause problems with restarting.  So we check to see if any of our threads are stopped
// at a breakpoint, and if so we remove all the breakpoints, resume the process, and THEN
// destroy it again.
//
// Note, we don't have a good way to test the version of debugserver, but I happen to know that
// the set of all the iOS debugservers which don't support GetThreadSuffixSupported() and that of
// the debugservers with this bug are equal.  There really should be a better way to test this!
//
// We also use m_destroy_tried_resuming to make sure we only do this once, if we resume and then halt and
// get called here to destroy again and we're still at a breakpoint or exception, then we should
// just do the straight-forward kill.
//
// And of course, if we weren't able to stop the process by the time we get here, it isn't
// necessary (or helpful) to do any of this.