>
Odd. In that case what should happen is that the call to
>
xpsr_write() should cause env->thumb to be set, which is
>
the QEMU internal state that tracks whether we are in Arm
>
or Thumb mode.
>
>
I would recommend adding also int,exec,cpu,unimp to your tracing
>
options. That will allow you to confirm exactly what the CPU
>
state on return from the exception is, because it will print
>
a register state dump to the log. (the 'cpu' and 'exec' logs
>
do slow down the emulation a lot, but hopefully this bug
>
happens early in execution.)
I have turned on the log options and I find out the execution will go
into the same interrupt service routine for multiple times as soon as
it exits from execption handler, before it hits its expected return address.
So I look into the NVIC registers in cortex M3. I find out the ISPR
register (interrupt set pending registers) in NVIC is not function normally.
I made a breakpoint just before the code exit the exception handler.
And I use 'x /20xw 0xe000e200' to check the ISPR register. At this point, the
value is 0x0, and then I type 'si' to gdb, and the code go to the expected return
address. Then I 'x /20xw 0xe000e200' again, but this time, the value is 0x10,
which indicates an interrupt is pending. If I type 'c' in gdb, the code will go to the
interrupt service routine again.
Do you have any idea in mind?
Thanks a lot! I am looking forward to your reply.