Using the Threads Dialog Box

When debugging a multithreaded program, you can select a single thread using the Threads dialog box.

To display the Threads dialog box

  • From the Debug menu, click Threads.

The Threads dialog box displays a list of all threads in the application. Using this list, you can set focus on, suspend, or resume execution of a thread.

To set focus on a thread

  1. In the Theads dialog box, select a thread from the Thread list.

  2. Click Set Focus.

To suspend a thread

  1. In the Theads dialog box, select a thread from the Thread list.

  2. Click Suspend.

To resume execution of a thread

  1. In the Theads dialog box, select a thread from the Thread list.

  2. Click Resume.

The Thread list in the Threads dialog box displays status information on each thread as follows:

The Thread ID column contains the DWORD that uniquely identifies each thread. When you set focus on a thread, an asterisk (*) appears next to its thread ID.

The Suspend column contains the suspension number of each thread. This number, which can vary from 0 through 127, is incremented each time you suspend the thread and decremented each time you resume the thread.

The Priority column contains the thread priority. A thread priority can be any of the following: Idle, Lowest, Below Normal, Normal, Above Normal, Highest, or Time Critical.

The Location column contains the function name or address associated with the thread. You can choose to see either the function name or the address.

To view the function name associated with each thread

  • In the Threads dialog box, select Name.

To view the address associated with each thread

  • In the Threads dialog box, select Address.

If Name is selected, the current function name appears if it is known by the debugger. If no function is known, the address appears. If Address is selected, the current address appears.

Note   If you are displaying thread locations by Name instead of by Address, each thread is typically shown with the function name in which its EIP currently resides. However, if the EIP is in a location where there are no symbols (for example, in the NT kernel), then Visual C++ displays, in brackets, the name of the topmost function on the stack for which symbols exist.