Debug in depth
C-42
Copyright 2000 ARM Limited. All rights reserved.
ARM DDI 0165B
Take, for example, the request by a debugger to breakpoint on the instruction at location
YYY when running process XXX in a multiprocess system. If the current process ID is
stored in memory, you can implement the above function with a watchpoint and
breakpoint chained together. The watchpoint address points to a known memory
location containing the current process ID, the watchpoint data points to the required
process ID, and the ENABLE bit is set to off.
The address comparator output of the watchpoint is used to drive the write enable for
the CHAINOUT latch. The input to the latch is the output of the data comparator from
the same watchpoint. The output of the latch drives the CHAIN input of the breakpoint
comparator. The address YYY is stored in the breakpoint register, and when the
CHAIN input is asserted, the breakpoint address matches, and the breakpoint triggers
correctly.
C.13.2
DBGRNG signal
The DBGRNG signal is derived as follows:
DBGRNG = ((({Av[31:0],Cv[4,2:0]} XNOR {A[31:0],C[4,2:0]}) OR
{Am[31:0],Cm[4:0]}) == 0xFFFFFFFFF) AND
((({Dv[31:0],Cv[7:5]} XNOR {D[31:0],C[7:5]}) OR
Dm[31:0],Cm[7:5]}) == 0x7FFFFFFFF)
The RANGE input to Watchpoint unit 0 is derived as the address comparison of
Watchpoint unit 1, that is:
RANGEIN = ((Av[31:0] XNOR A[31:0]) OR Am[31:0] == 0xFFFF FFFF)
This RANGE input allows you to couple two breakpoints together to form range
breakpoints.
Selectable ranges are restricted to being powers of 2. For example, if a breakpoint is to
occur when the address is in the first 256 bytes of memory, but not in the first 32 bytes,
program the watchpoint registers as follows:
For Watchpoint 1:
1.
Program Watchpoint 1 with an address value of 0x00000000 and an address
mask of 0X0000001F.
2.
Clear the ENABLE bit.
3.
Program all other Watchpoint 1 registers as normal for a breakpoint.
An address within the first 32 bytes causes the RANGE output to go HIGH
because the address matches, but does not trigger the breakpoint because the
ENABLE is LOW.