Library /sys$common/syshlp/DBG$HELP.HLB  —  DEBUG  SET  WATCH  Global Section Watchpoints
    On Alpha processors, you can set watchpoints on variables or
    arbitrary program locations in global sections. A global section
    is a region of memory that is shared among all processes of a
    multiprocess program. A watchpoint that is set on a location in
    a global section (a global section watchpoint) triggers when any
    process modifies the contents of that location.

    You set a global section watchpoint just as you would set a
    watchpoint on a static variable. However, because of the way the
    debugger monitors global section watchpoints, note the following
    point. When setting watchpoints on arrays or records, performance
    is improved if you specify individual elements rather than the
    entire structure with the SET WATCH command.

    If you set a watchpoint on a location that is not yet mapped to
    a global section, the watchpoint is treated as a conventional
    static watchpoint. When the location is subsequently mapped
    to a global section, the watchpoint is automatically treated
    as a global section watchpoint and an informational message is
    issued. The watchpoint is then visible from each process of the
    multiprocess program.

    Examples

    1.DBG> SET WATCH MAXCOUNT

    This command establishes a watchpoint on the variable MAXCOUNT.

    2.DBG> SET WATCH ARR
      DBG> GO
           . . .
      watch of SUBR\ARR at SUBR\%LINE 12+8
         old value:
          (1):         7
          (2):         12
          (3):         3
         new value:
          (1):         7
          (2):         12
          (3):         28

      break at SUBR\%LINE 14
      DBG>

    In this example, the SET WATCH command sets a watchpoint on
    the three-element integer array, ARR. Execution is then resumed
    with the GO command. The watchpoint triggers whenever any array
    element changes. In this case, the third element changed.

    3.DBG> SET WATCH ARR(3)

    This command sets a watchpoint on element 3 of array ARR (Fortran
    array syntax). The watchpoint triggers whenever element 3
    changes.

    4.DBG> SET WATCH P_ARR[3:5]

    This command sets a watchpoint on the array slice consisting
    of elements 3 to 5 of array P_ARR (Pascal array syntax). The
    watchpoint triggers whenever any of these elements change.

    5.DBG> SET WATCH P_ARR[3]:P_ARR[5]

    This command sets a separate watchpoint on each of elements 3 to
    5 of array P_ARR (Pascal array syntax). Each watchpoint triggers
    whenever its target element changes.

    6.DBG> SET TRACE/SILENT SUB2 DO (SET WATCH K)

    In this example, variable K is a nonstatic variable and is
    defined only when its defining routine, SUB2, is active (on
    the call stack). The SET TRACE command sets a tracepoint on
    SUB2. When the tracepoint is triggered during execution, the
    DO clause sets a watchpoint on K. The watchpoint is then canceled
    when execution returns from routine SUB2. The /SILENT qualifier
    suppresses the "trace . . . " message and the display of source
    code at the tracepoint.

    7.DBG> g
      %DEBUG-I-ASYNCSSWAT, possible asynchronous system service and static
      watchpoint collision break at LARGE_UNION\main\%LINE 24192+60
      DBG> sho call
      module name      routine name     line        rel PC             abs PC
      *LARGE_UNION     main             24192   00000000000003A0    00000000000303A0
      *LARGE_UNION     __main           24155   0000000000000110    0000000000030110
                                                FFFFFFFF80B90630    FFFFFFFF80B90630
      DBG> ex/sour %line 24192
      module LARGE_UNION
      24192:    sstatus = sys$getsyi (EFN$C_ENF, &sysid, 0, &syi_ile, &myiosb, 0, 0);

    In this example, an asynchronous write by SYS$QIO to its IOSB
    output parameter fails if that IOSB is being watched directly
    or even if it simply lives on the same page as an active static
    watchpoint.

    Debugger notices this problem and warns the user about potential
    collisions between static watchpoints and asynchronous system
    services.
Close Help