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?
Thank you.
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.
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.
You can see the stack traces for each active thread on the debugger view. (Run->Debugger). In the top left panel you should be able to see the stack trace for the current thread. It should say something like "Thread-1" at the top, click on this and you can select any of the other threads, and view their individual stack traces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With