lldb的process connect connect之后一般等多久?

warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.

十几秒

这是典型的,低版本xcode/lldb调试高版本ios造成的符号缓存错误,造成lldb错误地从内存读取符号。可以参考我的开源项目JBDev的readme获取解决方法,以下是分析过程

15.x arm64e lldb connect初始化异常缓慢 分析

log enable lldb host
process connect connect://127.0.0.1:111

Process::ReadModuleFromMemory reading /usr/lib/xxx.dylib binary from memory

lldb符号搜索:
14.8.1 读本地iOS DeviceSupport 25秒
15.4.1 读进程内存 90秒

14.8.1
Found a copy of /usr/lib/dyld in the SDK dir /Users/me/Library/Developer/Xcode/iOS DeviceSupport/14.8.1 (18H107) arm64e/Symbols

/Developer/Library/Daemons/DTFetchSymbols

PlatformRemoteDarwinDevice.cpp
GetFileInSDK Found a copy of %s in the SDK dir %s/%s
GetSymbolFile Found a copy of %s in the DeviceSupport dir %s
Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal
Found a copy of %s in the DeviceSupport dir %s/Symbols

RemoteAwarePlatform::ConnectProcess
Platform::ConnectProcess
Platform::DoConnectProcess
Process::ConnectRemote
Process::CompleteAttach
DynamicLoaderDarwin::DidAttach
DynamicLoaderMacOS::DoInitialImageFetch
DynamicLoaderDarwin::AddModulesUsingImageInfos
DynamicLoaderDarwin::FindTargetModuleForImageInfo
Target::GetOrCreateModule
PlatformRemoteDarwinDevice::GetSharedModule
GetFileInSDK
ReadModuleFromMemory 未找到

14.8.1
有符号 “Try the last SDK index” ResolveExecutable module_sp获取成功
无符号 GetSharedModuleWithLocalCache module_sp获取失败
FindBundleBinaryInExecSearchPaths module_sp获取失败
从内存读模块
15.4.1
“Second try all SDKs that were found” ResolveExecutable
GetSharedModuleWithLocalCache module_sp获取失败
FindBundleBinaryInExecSearchPaths module_sp获取失败

结论: 高版本XCode(>=13)生成iOS DeviceSupport文件是正确的

1 个赞