如何在Xcode中的所有方法上自动设置断点? [英] How to automatically set breakpoints on all methods in Xcode?

查看:215
本文介绍了如何在Xcode中的所有方法上自动设置断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Xcode中的所有方法上自动设置断点?
我想知道我的程序如何工作,以及在与用户界面交互时调用哪些方法。

How do I automatically set breakpoints on all methods in Xcode? I want to know how my program works, and which methods invoke when I interact with the user interface.

推荐答案


  1. 在Xcode中运行您的应用。

  2. 按⌘⌃Y(调试->暂停)。

  3. 转到调试器控制台:⌘⇧C

  4. 键入 breakpoint set -r。 -s< PRODUCT_NAME> (插入应用程序的名称)。

  1. Run your app in Xcode.
  2. Press ⌘⌃Y (Debug -> Pause).
  3. Go to the debugger console: ⌘⇧C
  4. Type breakpoint set -r . -s <PRODUCT_NAME> (insert your app's name).

lldb会回答类似问题。 ..

lldb will answer with something like...

Breakpoint 1: 4345 locations

现在只需按继续按钮。

断点设置是lldb的命令创建断点。在功能/方法名称上使用正则表达式( -r )指定位置,在本例中为任何方法。 -s 选项用于将范围限制为可执行文件(需要排除框架)。

breakpoint set is lldb's command to create breakpoints. The location is specified using a regular expression (-r) on function/method names, in this case . which matches any method. The -s option is used to limit the scope to your executable (needed to exclude frameworks).

运行应用程序lldb现在将在应用程序从您的主要可执行文件中命中某个函数时中断。

When you run your app lldb will now break whenever the app hits a function from your main executable.

要禁用断点,请键入 breakpoint delete 1 (插入正确的断点号)。

To disable the breakpoints type breakpoint delete 1 (insert proper breakpoint number).

这篇关于如何在Xcode中的所有方法上自动设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆