Swift类中所有方法的LLDB断点

发布于 2025-01-22 01:53:22 字数 330 浏览 1 评论 0原文

如何使用LLDB在Swift类中的所有方法 /计算属性上设置断点?

我的用例是调试执行特定类型方法的流程,但我们也可以将命令用于一般调试/学习。

我发现语法是为所有方法创建一个objective-c类中的LLDB断点在这里,但这似乎对Swift类/结构不起作用。

How can I use LLDB to set a breakpoint on all methods / computed properties in a Swift class?

My use case is to debug the flow of executing a particular type’s methods but we could also use the command for general debugging/learning.

I found the syntax to create an LLDB breakpoint for all methods in an Objective-C class here, but this doesn't seem to work for Swift classes/structs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲爱恨情仇 2025-01-29 01:53:22

以下语法可用于为Swift类型中的每个符号(属性和方法)创建一个正则断点,包括struct s和class es。

假设一种称为circle的类型:

(lldb) break set -r "\.Circle\..*"

The following syntax works for creating a Regex breakpoint for every symbol (properties and methods) in a Swift type, including structs and classes.

Assuming a type called Circle:

(lldb) break set -r "\.Circle\..*"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文