D.2.2. Debug mode

The XScale microarchitecture adds a new processor mode, analogous to existing modes such as Undef mode, called Debug mode. The processor enters Debug mode when a debug event occurs, such as:

The debug handler uses the DCC on the chip to communicate with the host debugger. Because of this, the DCC cannot be used in other ways, for example:

There is no debug vector. Instead, the reset vector is overloaded so both the normal reset handler and the debug handler use it. There are therefore two cases:

The consequence of this overloading is that your application program cannot use a branch to location zero as a way of simulating a hard reset when a debugger is connected. However, because Multi-ICE has control over the processor it can emulate such a simulated reset, so if you force pc to zero within the debugger, Multi-ICE translates the branch to zero into a branch to the reset handler, so running the reset code. However, to do this it must emulate the instruction at the reset vector, and it only does this for the instructions:

where loc is an address offset.

The debug version of the reset vector is held in a cache line in a part of the cache called the mini-ICache. The mini-ICache is mapped over the memory starting at 0x0 and at 0xffff0000 and is used when the processor is in debug state.

Cache lines on current XScale processors are big enough to include every exception vector, not just the reset vector. This means that when a debugger is active, other exceptions, for example interrupts, also use the debug vectors, and might therefore fail.

Multi-ICE copies the currently defined vectors from normal memory to the mini-ICache before executing a program, and also before resuming after a single step or breakpoint. This works well provided that the program does not change the vectors itself. However, if a program changes an exception vector and then that exception occurs (for example, with a SWI opcode), the changed vector is ignored and the old value is used instead.

To avoid this:

  1. Place a breakpoint between writing to the exception vector address and the first time the exception can happen.

  2. Run the program.

  3. When the breakpoint is hit, use the debugger Continue or Go commands to continue program execution. As a result of continuing, Multi-ICE rewrites the mini-ICache vectors from main memory and so exceptions vector to the new handler.

Copyright © 1998-2002 ARM Limited. All rights reserved.ARM DUI 0048F