Xcode 完整堆栈跟踪 [英] Xcode full stack trace

查看:27
本文介绍了Xcode 完整堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然调试是为了查看完整的堆栈跟踪,主线程中调用的方法列表.或者以任何方式在命令窗口上打印它们.

While debugging is there anyway to see a complete stack trace, list of methods called in main thread. Or any way to print them on command window.

推荐答案

可以通过

NSLog(@"Stack trace : %@",[NSThread callStackSymbols]);

发生崩溃时,在单词 (lldb) 旁边,您可以输入:

Upon a crash, next to the word (lldb), you can type:

po [NSThread callStackSymbols]

为了在 Swift 的控制台上获得更好的输出,您可以改用以下行:

For better output on console on Swift you can use following line instead:

Thread.callStackSymbols.forEach{print($0)}

这篇关于Xcode 完整堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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