The user needs to adjust pc for exceptions that occured while in Thumb mode.
+
+
'''Flags for svcGetDebugThreadContext/svcSetDebugThreadContext''':
+
+
{| class="wikitable" border="1"
+
|-
+
! Bit
+
! Description
+
|-
+
| 0
+
| Get/set CPU GPRs (r0-r12)
+
|-
+
| 1
+
| Get/set CPU SPRs (sp, lr, pc, cpsr)
+
|-
+
| 2
+
| Get/set FPU GPRs (d0-d15)
+
|-
+
| 3
+
| Get/set FPU SPRs (fpscr, fpexc)
+
|}
+
+
When setting CPSR, the following assignment is done: <code>ctx->cpsr = ctx->cpsr & 0x7F0FDFF | userCtx->cpuRegisters.cpsr & 0xF80F0200;</code>. This is to avoid obvious security issues.