Xcode。无法在断点处停止

Posted

技术标签:

【中文标题】Xcode。无法在断点处停止【英文标题】:Xcode. Unable to stop at breakpoint 【发布时间】:2018-09-22 19:45:50 【问题描述】:

我在调试 ios 应用程序时遇到问题。当应用程序到达断点时,它会停在那里一秒钟,然后调试器崩溃。 (应用程序不会崩溃,只有调试器会崩溃。这种行为类似于设备处于调试模式时与电缆断开连接)。

Xcode 控制台的打印:

来自调试器的消息:LLDB RPC 服务器已崩溃。崩溃日志 位于 ~/Library/Logs/DiagnosticReports 并有一个前缀 'lldb-rpc-服务器'。请提交错误并附上最近的崩溃 记录。

我检查了崩溃日志,这是文件的一部分:

Process:               lldb-rpc-server [21320]
Path:                  /Applications/Xcode.app/Contents/SharedFrameworks/LLDBRPC.framework/Versions/A/Resources/lldb-rpc-server
Identifier:            lldb-rpc-server
Version:               2
Code Type:             X86-64 (Native)
Parent Process:        Xcode [15500]
Responsible:           lldb-rpc-server [21320]
User ID:               502

Date/Time:             2018-04-12 17:20:19.901 +0300
OS Version:            Mac OS X 10.13.4 (17E199)
Report Version:        12
Anonymous UUID:        BCD9F4BE-3ECF-2DD0-68EC-671CF1821432


Time Awake Since Boot: 24000 seconds

System Integrity Protection: enabled

Crashed Thread:        8  RPC packet thread for client tid 00055ab9 (350905)

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
Stack dump:
0.  error finding type for _T07Staging11AppDelegateCD
abort() called

Thread 8 Crashed:: RPC packet thread for client tid 00055ab9 (350905)
0   libsystem_kernel.dylib          0x00007fff70cdcb6e __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff70ea7080 pthread_kill + 333
2   libsystem_c.dylib               0x00007fff70c3824d __abort + 144
3   libsystem_c.dylib               0x00007fff70c381bd abort + 142
4   com.apple.LLDB.framework        0x000000011132acdd swift::ModuleFile::fatal(llvm::Error) + 1213
5   com.apple.LLDB.framework        0x0000000111332711 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 27649
6   com.apple.LLDB.framework        0x0000000111359e39 swift::ModuleFile::lookupValue(swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&) + 841
7   com.apple.LLDB.framework        0x0000000110b43f9a swift::ModuleDecl::lookupValue(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, swift::NLKind, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 90
8   com.apple.LLDB.framework        0x0000000110b4e8aa void lookupInModule<llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType>, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0>(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0) + 346
9   com.apple.LLDB.framework        0x0000000110b4e71e swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1278
10  com.apple.LLDB.framework        0x0000000110b550e1 swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1089
11  com.apple.LLDB.framework        0x0000000110c56db2 DeclsLookupSource::lookupQualified(swift::Identifier, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) + 226
12  com.apple.LLDB.framework        0x0000000110c5693d FindFirstNamedDeclWithKind(swift::ASTContext*, llvm::StringRef const&, swift::DeclKind, VisitNodeResult&, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >) + 301
13  com.apple.LLDB.framework        0x0000000110c5608c VisitNodeIdentifier(swift::ASTContext*, swift::Demangle::Node*, swift::Demangle::Node*, VisitNodeResult&) + 124
14  com.apple.LLDB.framework        0x0000000110c4ebf7 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 199
15  com.apple.LLDB.framework        0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
16  com.apple.LLDB.framework        0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
17  com.apple.LLDB.framework        0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
18  com.apple.LLDB.framework        0x0000000110c5475c swift::ide::getTypeFromMangledSymbolname(swift::ASTContext&, llvm::StringRef, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 204
19  com.apple.LLDB.framework        0x000000011172ceda lldb_private::SwiftASTContext::GetTypeFromMangledTypename(char const*, lldb_private::Error&) + 532
20  com.apple.LLDB.framework        0x00000001114a5101 DWARFASTParserSwift::ParseTypeFromDWARF(lldb_private::SymbolContext const&, DWARFDIE const&, lldb_private::Log*, bool*) + 887
21  com.apple.LLDB.framework        0x00000001115c2623 SymbolFileDWARF::ParseType(lldb_private::SymbolContext const&, DWARFDIE const&, bool*) + 171
22  com.apple.LLDB.framework        0x00000001115bc33f SymbolFileDWARF::GetTypeForDIE(DWARFDIE const&, bool) + 369
23  com.apple.LLDB.framework        0x00000001115bbc6e SymbolFileDWARF::ResolveType(DWARFDIE const&, bool, bool) + 68
24  com.apple.LLDB.framework        0x00000001115bbbed SymbolFileDWARF::ResolveTypeUID(unsigned long long) + 45
25  com.apple.LLDB.framework        0x00000001116390d7 lldb_private::SymbolFileType::GetType() + 51
26  com.apple.LLDB.framework        0x000000011147be4f lldb_private::ValueObjectVariable::GetCompilerTypeImpl() + 21
27  com.apple.LLDB.framework        0x000000011146cf67 lldb_private::ValueObject::MaybeCalculateCompleteType() + 39
28  com.apple.LLDB.framework        0x00000001114712dd lldb_private::ValueObject::GetObjectRuntimeLanguage() + 33
29  com.apple.LLDB.framework        0x000000011147167b lldb_private::ValueObject::IsRuntimeSupportValue() + 73
30  com.apple.LLDB.framework        0x000000010eb3faec lldb::SBFrame::GetVariables(lldb::SBVariablesOptions const&) + 624
31  com.apple.LLDB.framework        0x000000010eb3fda4 lldb::SBFrame::GetVariables(bool, bool, bool, bool, lldb::DynamicValueType) + 208
32  lldb-rpc-server                 0x000000010e8b0aef rpc_server::_ZN4lldb7SBFrame12GetVariablesEbbbbNS_16DynamicValueTypeE::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 219
33  lldb-rpc-server                 0x000000010e87662a rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 506
34  lldb-rpc-server                 0x000000010e87730c rpc_common::Connection::HandleRPCPacket(rpc_common::RPCPacket&) + 62
35  lldb-rpc-server                 0x000000010e87a862 Packets::ProcessPackets() + 254
36  lldb-rpc-server                 0x000000010e87a68b Packets::ReadThread() + 187
37  lldb-rpc-server                 0x000000010e87a5cb Packets::RunReadThread(void*) + 9
38  libsystem_pthread.dylib         0x00007fff70ea4661 _pthread_body + 340
39  libsystem_pthread.dylib         0x00007fff70ea450d _pthread_start + 377
40  libsystem_pthread.dylib         0x00007fff70ea3bf9 thread_start + 13

(完整的输出可以在这里找到) https://pastebin.com/18ZE08kv

第 28 行说:

    _T07Staging11AppDelegateCD 的错误查找类型

有人知道这个错误是什么意思吗? 任何帮助将不胜感激。

问候

【问题讨论】:

【参考方案1】:

只需将断点移动一行。清理项目并尝试再次运行,它应该可以解决您的问题。

【讨论】:

谢谢,您的回答很有帮助,即使在某些情况下它仍然会崩溃,但至少我可以继续工作。谢谢。 对不起,但我是 *** 的新手,我的声誉少于 15 个,因此我无法投票。再次谢谢你。

以上是关于Xcode。无法在断点处停止的主要内容,如果未能解决你的问题,请参考以下文章

XCTAssertThrows 在断点处停止

Xdebug 停止工作并且无法在断点处停止

Xcode 11 断点仅在 HEX 代码上停止

Qt 调试崩溃/退出 python 并最终无法正确调试(例如,不在断点处停止)

“一个或多个断点无法设置且已被禁用。执行将在程序开始处停止。”

断点停止但也不例外