thread subcommand for dbx: Display a list of active threads

Format

Description

The thread subcommand displays a list of active threads for the application program. All active threads are listed unless you use the number parameter to specify the threads you want listed. You can also select threads by their states using the activ, async, dead, or pcanc options.

You can use the info option to display full information about a thread, and threads can be held or unheld with the hold or unhold options. The focus thread is defaulted to the running thread; dbx uses it as the context for normal dbx subcommands such as register. You can use the current option to switch the dbx focus thread.

Examples

  1. To display all thread objects, enter:
    thread
  2. To display thread objects number 1 and 2, enter:
    thread 1 2
  3. To display all active threads, enter:
    thread activ
  4. To display all threads in dead state, enter:
    thread dead
  5. To display all threads in async state (that is, threads with a cancelability type of PTHREAD_INTR_ASYNCHRONOUS) that are waiting to be scheduled), enter:
    thread async

    Because this thread was created with the PTATASYNCHRONOUS attribute and the limit was reached, this thread was queued for execution. For example, if the thread limit is set to ten and there are 12 threads, two of them will be shown as async for the dbx thread command.

  6. To display all threads in pcanc state (that is, threads that have been requested to be canceled by pthread_cancel(), enter:
    thread pcanc
  7. To hold all threads, enter:
    thread hold
  8. To hold thread number 1 and 4, enter:
    thread hold 1 4
  9. To unhold thread number 1 and 4, enter:
    thread unhold 1 4
  10. To display the focus thread, enter:
    thread current
  11. To set the focus thread to thread number 1, enter:
    thread current 1
  12. To get information about thread number 3, enter:
    thread info 3