Using Sun WorkShop

Debugging Multithreaded Programs

When a multithreaded program is detected, the Sessions/Threads pane on the Debugging window opens. This pane can be toggled between displaying sessions and displaying threads. For a multithreaded program, the pane lists information about the threads in the currently selected process. The current thread is marked with a green arrow.

To view the context of another thread:

  1. Click the thread in the Threads pane.

    The call stack dynamically updates to reflect the context of the selected thread. The source display also updates. The context function and stopped in function are changed to their respective values for the new thread.

  2. To resume program execution, click Go.

To hide a thread:

  1. Click the thread in the Threads pane.

  2. Choose Threads > Hide Selected.

You can expose threads to help in managing them. To show all hidden threads, choose Threads > Expose Hidden.