Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display all the threads for my program when debug in Xcode

Tags:

xcode

macos

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.

like image 728
lucius Avatar asked May 30 '09 08:05

lucius


2 Answers

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.

enter image description here

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

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

enter image description here

and select view process by thread. enter image description here

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. enter image description here

like image 148
Paul Kahohi Avatar answered Sep 25 '22 00:09

Paul Kahohi


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.

like image 24
Tom Jefferys Avatar answered Sep 23 '22 00:09

Tom Jefferys