/sys$common/syshlp/DBG$HELP.HLB  —  DEBUG  SHOW  TASK
    Displays information about the tasks of a multithread program
    (also called a tasking program).

                                   NOTE

       SET TASK and SET THREAD are synonymous commands. They
       perform identically.

    Format

      SHOW THREAD  [task-spec[, . . . ]]

1  –  Parameters

 task-spec

    Specifies a task value. Use any of the following forms:

    o  When the event facility is THREADS:

       -  A task (thread) name as declared in the program, or a
          language expression that yields a task ID number.

       -  A task ID number (for example, 2), as indicated in a SHOW
          THREAD display.

    o  When the event facility is ADA:

       -  A task (thread) name as declared in the program, or a
          language expression that yields a task value. You can use a
          path name.

       -  A task ID (for example, 2), as indicated in a SHOW THREAD
          display.

    o  One of the following task built-in symbols:

       %ACTIVE_TASK    The task that runs when a GO, STEP, CALL, or
                       EXIT command executes.
       %CALLER_TASK    (Applies only to Ada programs.) When an accept
                       statement executes, the task that called the
                       entry associated with the accept statement.
       %NEXT_TASK      The task after the visible task in the
                       debugger's task list. The ordering of tasks
                       is arbitrary but consistent within a single
                       run of a program.
       %PREVIOUS_      The task previous to the visible task in the
       TASK            debugger's task list.
       %VISIBLE_TASK   The task whose call stack and register set are
                       the current context for looking up symbols,
                       register values, routine calls, breakpoints,
                       and so on.

    Do not use the asterisk (*)  wildcard character. Instead, use the
    /ALL qualifier. Do not specify a task with /ALL, /STATISTICS, or
    /TIME_SLICE.

2  –  Qualifiers

2.1    /ALL

    Selects all existing tasks for display-namely, tasks that have
    been created and (in the case of Ada tasks) whose master has not
    yet terminated.

2.2    /CALLS

       /CALLS[=n]

    Does a SHOW CALLS command for each task selected for display.
    This identifies the currently active routine calls (the call
    stack) for a task.

2.3    /FULL

    When the event facility is THREADS, use the

      PTHREAD thread -f thread-number
 command.

    Displays additional information for each task selected for
    display. The additional information is provided if you use /FULL
    by itself or with /CALLS or /STATISTICS.

    You can get help on POSIX threads debugger commands by typing
    PTHREAD HELP.

    See the Guide to the POSIX Threads Library for more information
    about using the POSIX threads debugger.

2.4    /HOLD

       /HOLD
       /NOHOLD (default)

    When the event facility is THREADS, use the PTHREAD tset -n
    thread-number command.

    Selects either tasks that are on hold, or tasks that are not on
    hold for display.

    If you do not specify a task, /HOLD selects all tasks that are on
    hold. If you specify a task list, /HOLD selects the tasks in the
    task list that are on hold.

    If you do not specify a task, /NOHOLD selects all tasks that
    are not on hold. If you specify a task list, /NOHOLD selects the
    tasks in the task list that are not on hold.

    You can get help on POSIX threads debugger commands by typing
    PTHREAD HELP.

    See the Guide to the POSIX Threads Library for more information
    about using the POSIX threads debugger.

2.5    /IMAGE

    Displays the image name for each active call on the call stack.
    Valid only with the /CALLS qualifier.

2.6    /PRIORITY

       /PRIORITY=(n[, . . . ])

    When the event facility is THREADS, use the PTHREAD tset -s
    thread-number command.

    If you do not specify a task, selects all tasks having any of
    the specified priorities, n, where n is a decimal integer from 0
    to 15. If you specify a task list, selects the tasks in the task
    list that have any of the priorities specified.

    You can get help on POSIX threads debugger commands by typing
    PTHREAD HELP.

    See the Guide to the POSIX Threads Library for more information
    about using the POSIX threads debugger.

2.7    /STATE

       /STATE=(state[, . . . ])

    If you do not specify a task, selects all tasks that are in any
    of the specified states-RUNNING, READY, SUSPENDED, or TERMINATED.
    If you specify a task list, selects the tasks in the task list
    that are in any of the states specified.

3  –  Description

    A task can first appear in a SHOW THREAD display as soon as it
    is created. A task can no longer appear in a SHOW THREAD display
    if it is terminated or (in the case of an Ada tasking program)
    if its master is terminated. By default, the SHOW THREAD command
    displays one line of information for each task selected.

    When you specify the /IMAGE qualifier, the debugger first does a
    SET IMAGE command for each image that has debug information (that
    is, it was linked using the /DEBUG or /TRACEBACK qualifier). The
    debugger then displays the image name for each active call on the
    calls stack. The output display has been expanded and displays
    the image name in the first column.

    The debugger suppresses the share$image_name module name, because
    that information is provided by the /IMAGE qualifier.

    The SET IMAGE command lasts only for the duration of the SHOW
    THREAD/CALLS/IMAGE command. The debugger restores the set image
    state when the SHOW THREAD/CALLS/IMAGE command is complete.

    Related commands:

       DEPOSIT/TASK
       EXAMINE/TASK
       (SET, SHOW) EVENT_FACILITY
       SET TASK|THREAD

4  –  Examples

    1.DBG> SHOW EVENT_FACILITY
      event facility is ADA

           . . .
      DBG> SHOW TASK/ALL
        task id   pri hold state   substate        task object
      * %TASK 1    7       RUN                   122624
        %TASK 2    7  HOLD SUSP  Accept          H4.MONITOR
        %TASK 3    6       READY Entry call      H4.CHECK_IN
      DBG>

      In this example, the SHOW EVENT_FACILITY command identifies
      ADA as the current event facility. The SHOW TASK/ALL command
      provides basic information about all the tasks that were
      created through Ada services and currently exist. One line
      is devoted to each task. The active task is marked with an
      asterisk (*).  In this example, it is also the active task (the
      task that is in the RUN state).

    2.DBG> SHOW TASK %ACTIVE_TASK,3,MONITOR

      This command selects the active task, 3, and task MONITOR for
      display.

    3.DBG> SHOW TASK/PRIORITY=6

      This command selects all tasks with priority 6 for display.

    4.DBG> SHOW TASK/STATE=(RUN,SUSP)

      This command selects all tasks that are either running or
      suspended for display.

    5.DBG> SHOW TASK/STATE=SUSP/NOHOLD

      This command selects all tasks that are both suspended and not
      on hold for display.

    6.DBG> SHOW TASK/STATE=(RUN,SUSP)/PRIO=7 %VISIBLE_TASK, 3

      This command selects for display those tasks among the visible
      task and %TASK 3 that are in either the RUNNING or SUSPENDED
      state and have priority 7.
Close Help