Xcode LLDB 观察点 [英] Xcode LLDB watchpoints
问题描述
有没有办法使用 LLDB 在 Xcode 中观察变量?还是只有 GDB 才有可能?我正在尝试使用命令 watchpoint set variable
但我收到消息:
Is there any way to watch a variable in Xcode using LLDB ? Or is this only possible with GDB ?
I'm trying to use the command watchpoint set variable
but I get the message:
无效的命令观察点设置"
invalid command 'watchpoint set'
推荐答案
从 Xcode 4.5 开始,iOS 和 Mac OS X 调试支持观察点.要在名为 foo
的变量上设置断点,请执行
Watchpoints are supported for iOS and Mac OS X debugging as of Xcode 4.5. To set a breakpoint on a variable named foo
, do
(lldb) watchpoint set variable foo
您始终可以在 lldb 控制台中为命令使用最短的明确名称
you can always use the shortest unambiguous name for commands in the lldb console so
(lldb) w s v foo
在这里也可以.
在 Xcode 中,在本地窗口中,您可以右键单击/控制单击变量,您可以选择在其上设置观察点.
In Xcode, in the locals window you can right-click/control-click on variables and you'll have an option to set a watchpoint on it.
当前的 arm 和 x86 cpus 仅支持 4 个观察点同时处于活动状态.
The current arm and x86 cpus only support 4 watchpoints being active at the same time.
这篇关于Xcode LLDB 观察点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!