Strange behaviour with MSR?
Hello,
I'm not sure I'm on the right list to post, sorry about that, but I tried on IRC and got no answer.
I'm working on a low level piece of system, which has to change PSR values on ARM.
I use qemu-system-arm v 2.0.0, with the command : qemu-system-arm -nographic -s -S -m 1024 -M vexpress-a9 -kernel ./bootstrap
My issue is the following: Just before the MSR call, I have an LR value. When executing MSR, the LR value gets nulled.
After a second iteration, MSR does *not* set this value to 0.
I really don't see wether it can come from qemu, if I'm writting this message, I think it does not come from my code, since the reset caused by the lr = 0 restarts the system, and thus, re initilizes the context with the same values and same call graph.
Here is a gdb trace from the issue :
(gdb) target remote 127.0.0.1:1234
Remote debugging using 127.0.0.1:12340x60000000 in ?? ()
(gdb) b *0x61005814
Breakpoint 1 at 0x61005814
(gdb) c
Continuing.
Breakpoint 1, 0x61005814 in ?? ()
(gdb) x /i $pc
=> 0x61005814: msr CPSR_fsxc, r3
(gdb) info reg
r0 0xe1a010b2 -509603662 r1 0x0 0 r2 0x2822001 42082305 r3 0xe1a010b2 -509603662 r4 0x0 0 r5 0x6100ec04 1627450372 r6 0x0 0 r7 0x0 0 r8 0x0 0 r9 0x0 0 r10 0x0 0 r11 0x60340be4 1614023652 r12 0x0 0 sp 0x60340bc0 0x60340bc0 lr 0x610057cc 1627412428 pc 0x61005814 0x61005814 cpsr 0x80000013 -2147483629 (gdb) si 0x61005818 in ?? () (gdb) info reg r0 0xe1a010b2 -509603662 r1 0x0 0 r2 0x2822001 42082305 r3 0xe1a010b2 -509603662 r4 0x0 0 r5 0x6100ec04 1627450372 r6 0x0 0 r7 0x0 0 r8 0x0 0 r9 0x0 0 r10 0x0 0 r11 0x60340be4 1614023652 r12 0x0 0 sp 0x0 0x0 lr 0x0 0 pc 0x61005818 0x61005818 cpsr 0xe0000092 -536870766
Thanks in advance for any piece of advice :)
--
François