Open dreampiggy opened 2 years ago
放一个工具链链接
公众号没有这篇啊
@yuzhouwww 公众号没有这篇啊
先暂时屏蔽,等公众号和平台审核完毕,避免误判为自己抄袭自己:)
备注:
Xcode 13.3不建议禁用symbols.use-swift-dwarfimporter false
,存在一个Bug导致,私有库的Objc类如UICTFont,会递归导致LLDB崩溃。已经修复在内部的工具链中,将预计在第二篇系列文章中解释原因
大佬,有针对Xcode13.4的工具链么,Xcode13.4无法真机调试,报错:
Unsupported Configuration The Swift standard library from the toolchain cannot be used on devices. Select a macOS or simulator run destination instead, or use a different toolchain that only provides the compiler.
@hsuyelin 试试这个:5.6.1,和5.6相比变化不大
Xcode 13.3导致部分项目po提示Couldn’t realize type of self, 这个有解决方案了吗? WWDC 2022
Xcode 13.3导致部分项目po提示Couldn’t realize type of self, 这个有解决方案了吗? WWDC 2022
使用上文的,5.6.1 toolchain
原因WWDC的Adrian提到过,是因为内置Swift编译器的参数和LLDB获取到的参数不一致,一般是因为你们预二进制的static archive Swiftmodule,没有最终通过-add_ast_path
传给链接器,导致LLDB内置Swift编译器获取不到相关的Search Paths
我在修正版的LLDB中通过其他方式集成和获取了同样的参数,保证尽量Match二进制期间的参数,目前在飞书测试良好
@dreampiggy
Xcode 13.3导致部分项目po提示Couldn’t realize type of self, 这个有解决方案了吗? WWDC 2022
使用上文的,5.6.1 toolchain
原因WWDC的Adrian提到过,是因为内置Swift编译器的参数和LLDB获取到的参数不一致,一般是因为你们预二进制的static archive Swiftmodule,没有最终通过
-add_ast_path
传给链接器,导致LLDB内置Swift编译器获取不到相关的Search Paths我在修正版的LLDB中通过其他方式集成和获取了同样的参数,保证尽量Match二进制期间的参数,目前在飞书测试良好
@dreampiggy
Xcode 13.3导致部分项目po提示Couldn’t realize type of self, 这个有解决方案了吗? WWDC 2022
使用上文的,5.6.1 toolchain
原因WWDC的Adrian提到过,是因为内置Swift编译器的参数和LLDB获取到的参数不一致,一般是因为你们预二进制的static archive Swiftmodule,没有最终通过
-add_ast_path
传给链接器,导致LLDB内置Swift编译器获取不到相关的Search Paths我在修正版的LLDB中通过其他方式集成和获取了同样的参数,保证尽量Match二进制期间的参数,目前在飞书测试良好
thx
所以 Couldn’t realize type of self 这个问题会在官方 5.7 修复掉吗?
@yansaid 目前5.7的LLDB代码中没有包括.
See: https://github.com/apple/llvm-project/pull/3353#issuecomment-1098666002
默认情况下,po的context下,Swift只会继承来主二进制(链接器参数-add_ast_path
)的Module和serialize-debugging-options
写入的Search Paths;
但是有时候跨机器和模块编译的Search Path是不同的;我在兼容模式下,会通过从当前po类型所在Module,找到之前通过的context,递归解析swiftmodule/interface得到的Search Paths,补全进来。代价是第一次稍微慢一点
其实最合理的修复建议是,保证每一个你们的swiftmodule static archive(比如,你们跨机器编译的,或者从某个第三方来的Swift静态库),全部塞到最终的链接器参数中
-Wl,-add_ast_path /path/to/libMyLib1.swiftmodule -Wl,-add_ast_path /path/to/libMyLib2.swiftmodule ...
Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
老哥,用了你提供的这个工具一段时间后,一直报这个crash,这个是因为什么呢?
Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
老哥,用了你提供的这个工具一段时间后,一直报这个crash,这个是因为什么呢?
完整堆栈发上来,~/Library/Logs/DiagnosticReports
下的lldb-rpc-server进程,或者你用Console.app找
Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log. 老哥,用了你提供的这个工具一段时间后,一直报这个crash,这个是因为什么呢?
完整堆栈发上来,
~/Library/Logs/DiagnosticReports
下的lldb-rpc-server进程,或者你用Console.app找
Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log. 老哥,用了你提供的这个工具一段时间后,一直报这个crash,这个是因为什么呢?
完整堆栈发上来,
~/Library/Logs/DiagnosticReports
下的lldb-rpc-server进程,或者你用Console.app找
老哥,这个问题有帮忙看吗?
使用方法:
使用方法:
- tar -xzf your_download_lldb_framework_path.tar.gz -C ~/
- Xcode选择Toolchains -> Xcode 14.0 (LLDB)
- 如果遇到报错可Command + Q重启再试
感谢老哥👍🏻
使用方法:
- tar -xzf your_download_lldb_framework_path.tar.gz -C ~/
- Xcode选择Toolchains -> Xcode 14.0 (LLDB)
- 如果遇到报错可Command + Q重启再试
大佬,我今天试了一下,除了首次进入断点快了一些,po、p、v都没怎么快,之前提供的5.6.1的就快了很多
少数settings的默认值修改过,一般无脑接入即可,不需要lldbinit修改
大佬,有办法能让macos13.0使用xcode13.4么。虽然可以通过命令行方式打开,但是每次都用命令行很麻烦,有没有骚操作
Message ID: @.***>
xcode 15.0 巨慢有啥好解决办法么
Swift 5.9已经做了一定的性能改动,另外现在po self.foobar
已经会被翻译为 expr self.foobar
并直接通过地址解析变量,而不是JIT,按理说效果应该会好很多。
https://www.swift.org/blog/whats-new-swift-debugging-5.9/
如果还有问题,后续再看是不是提供自定义编译的LLDB
https://dreampiggy.com/2022/05/07/Swift-%E8%B0%83%E8%AF%95%E6%80%A7%E8%83%BD%E7%9A%84%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88/
声明此篇文章预计5月中,发布于微信公众号《字节跳动终端技术》,原作者就是我,版权所有。在个人博客这里转发去掉了招聘相关的文案。如果需要也可以进行进一步交流(邮件或者GitHub)提供试用版工具链。 公众号链接: 背景通常来说,大型Swift项目常含有大量混编(Objc/C/C++甚至是Rust)代码,含有超过100个以上的Swift Module,并可能同时包含二进制部分和源码部分。而这种大型项目