ARM ARM7TDMI User Manual Page 248

  • Download
  • Add to my manuals
  • Print
  • Page
    / 284
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 247
Debug in Depth
B-30 Copyright © 1994-2001. All rights reserved. ARM DDI 0029G
Debug entry adds four addresses to the PC and every instruction adds one address. The
difference from breakpoint is that the instruction that caused the watchpoint has
executed and the program must return to the next instruction.
B.9.3 Watchpoint with another exception
If a watchpointed access simultaneously causes a Data Abort, the ARM7TDMI core
enters debug state in abort mode. Entry into debug is held off until the core changes into
abort mode and has fetched the instruction from the abort vector.
A similar sequence follows when an interrupt, or any other exception, occurs during a
watchpointed memory access. The ARM7TDMI core enters debug state in the mode of
the exception. The debugger must check to see if an exception has occurred by
examining the current and previous mode, in the CPSR and SPSR, and the value of the
PC. When an exception has taken place, you must give the user the choice of servicing
the exception before debugging.
Entry to debug state when an exception has occurred causes the PC to be incremented
by three instructions rather than four and this must be considered in return branch
calculation when exiting debug state. For example, suppose that an abort occurs on a
watchpointed access and ten instructions have been executed to determine this
eventuality. You can use the following sequence to return to program execution:
0 E1A00000; MOV R0, R0
1 E1A00000; MOV R0, R0
0 EAFFFFF0; B -16
This code forces a branch back to the abort vector, causing the instruction at that
location to be refetched and executed.
Note
After the abort service routine, the instruction that caused the abort and watchpoint is
refetched and executed. This triggers the watchpoint again and the ARM7TDMI core
re-enters debug state.
B.9.4 Debug request
Entry into debug state through a debug request is similar to a breakpoint. However,
unlike a breakpoint, the last instruction has completed execution and so must not be
refetched on exit from debug state. You can assume that entry to debug state adds three
addresses to the PC and every instruction executed in debug state adds one address.
For example, suppose that you have invoked a debug request and decided to return to
program execution straight away. You can use the following sequence:
Page view 247
1 2 ... 243 244 245 246 247 248 249 250 251 252 253 ... 283 284

Comments to this Manuals

No comments