【发布时间】:2015-09-12 21:58:32
【问题描述】:
我正在像这样在 lldb 中添加一个断点:
(lldb) breakpoint set -s MyApp --func-regex .
(lldb) breakpoint command add 1
Enter your debugger command(s). Type 'DONE' to end.
> p __PRETTY_FUNCTION__
> continue
> DONE
(lldb) process attach --name MyApp --waitfor
(lldb) continue
我的目标是打印我的应用程序中调用的每个方法。结果如下:
(lldb) p __PRETTY_FUNCTION__
(const char [26]) $0 = "void $__lldb_expr(void *)"
(lldb) continue
Process 96238 resuming
Command #1 'continue' continued the target.
(lldb) p __PRETTY_FUNCTION__
(const char [47]) $1 = "-[AppDelegate($__lldb_category) $__lldb_expr:]"
(lldb) continue
Process 96238 resuming
Command #1 'continue' continued the target.
(lldb) p __PRETTY_FUNCTION__
(const char [47]) $2 = "-[AppDelegate($__lldb_category) $__lldb_expr:]"
(lldb) continue
Process 96238 resuming
Command #1 'continue' continued the target.
(lldb) p __PRETTY_FUNCTION__
(const char [47]) $3 = "-[AppDelegate($__lldb_category) $__lldb_expr:]"
(lldb) continue
Process 96238 resuming
Command #1 'continue' continued the target.
(lldb) p __PRETTY_FUNCTION__
(const char [47]) $4 = "-[AppDelegate($__lldb_category) $__lldb_expr:]"
(lldb) continue
问题是如何删除 $__lldb_category 和 $__lldb_expr: 以及方法名称的实际值及其选择器?
【问题讨论】:
-
@rmaddy 他没有“查看”任何堆栈跟踪:这些是打印并继续的断点
-
@matt 是的,现在我明白了。
-
我希望获得函数调用的年表,并以一种简单的方式完成它,而不是在我的代码中放置大量 NSLog 语句。
标签: ios objective-c lldb