在Xcode中进行调试时,如何显示程序的所有线程 [英] How can I display all the threads for my program when debug in Xcode

查看:1079
本文介绍了在Xcode中进行调试时,如何显示程序的所有线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode中调试时,如何显示程序的所有线程? 我正在使用eclipse进行java调试,它可以显示程序中的所有当前线程 我可以挂起它们中的每一个,并显示它们当前的堆栈跟踪.我可以在XCode中做同样的事情吗?

How can I display all the threads for my program when debug in Xcode? I am using eclipse for java debugging, it can show all the current threads in the program and I can suspend each one of them and show their current stack trace. Can I do that same in XCode?

谢谢.

推荐答案

运行应用程序后,将自动出现调试区域.如果不太可能,是因为调试区域的可见性已关闭.打开它.切换xcode窗口右上角的第一个视图控件,然后将出现调试区域.

Once you run your application the debug area automatically comes up. If it doesen't most likely it's because the visibility of the debug area has been turned off. To turn it on. Toggle the first view control on the top right side of the xcode window and the debug area should appear.

完成后,将出现如下图所示的区域.

Once you have done that an area like the one in the image below will appear.

单击show debug navigator按钮,该按钮在调试导航器上的控件中排名倒数第三. 在您的项目名称旁边的第二行中,有两个按钮,单击第二个

Click on the show debug navigator button which is the third last in the controls on the debug navigator. On the row immediately after next to the name of your project, there are two buttons, click on the second

,然后按线程选择查看进程.

and select view process by thread.

要使线程出现,必须暂停您的应用程序.这可以通过在代码的特定点添加断点或通过单击源代码编辑器下方调试栏上的暂停按钮来手动完成.暂停后,线程将自动显示,如下所示.

For the threads to appear your application has to be paused. This can be done by adding a breakpoint at a particular point of the code or manually by clicking the pause button on the debug bar below the source editor. Once paused the threads appear automatically as shown below.

这篇关于在Xcode中进行调试时,如何显示程序的所有线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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