12.8.4. Writing to the CPSR in debug state

The only instruction that can update the CPSR while in debug state is the MSR instruction. All other ARMv7 instructions that write to the CPSR are Unpredictable, that is, the BX, BXJ, SETEND, CPS, RFE, LDM(3), and data processing instructions with Rd == r15 and S == 1.

The behavior of the CPSR forms of the MSR and MRS instructions in debug state is different to their behavior in normal state:

The debugger must execute an instruction memory barrier sequence after it writes to the CPSR execution state bits using an MSR instruction. If the debugger reads the CPSR using an MRS instruction after a write to any of these bits, but before an instruction memory barrier sequence, the value that MRS returns is Unpredictable. Similarly, if the debugger forces the processor to leave debug state after an MSR writes to the execution state bits, but before any instruction memory barrier sequence, the behavior of the processor in Unpredictable.

Copyright © 2006-2009 ARM Limited. All rights reserved.ARM DDI 0344I
Non-Confidential