I'm debugging the ARM Cortex A53 on the QEMU emulator using gdb debugger, any idea on how to get what exception level I'm running on (EL3/2/1/0) ?
Hi Boon Khai
I have moved your question to the Cortex-A forum, where someone may be able to help you.
Thanks
Oli from the Community team
Okay, thanks Oliver.
Check the system register "CurrentEL" (DDI0487Fc , chapter C5.2.1)
HI Bastian,
i'm aware of the CurrentEL register, but somehow I'm not able to print at gdb debugger. The picture showing the result on what I get when i try to print the CurrentEL register, I even try with different combination of capital letter, still not working. I try to dump the register info, not showing anything related to the CurrentEL register.
Hi Boon Khai,
In gdb the PSTATE is available as CPSR:
(gdb) info registers x0 0x1 1 ... cpsr 0x60000000 [ EL=0 C Z ] ...
Hi Vstehle,
I'm able to dump out the cpsr register, but I don't have the decoded register value like yours in the square bracket, referring to the document you shared, I don't find any bit specifying the Exception Level, only the NZVC APSR, etc...
Here is my cpsr at EL3 (i guess)
And here is my cpsr at EL0 (i guess, because it is now running the baremetal application)
gdb gets EL from CPSR bits 3:2.
(See also SPSR_EL1.M[3:2].)
CPSR 0x400003cd has indeed EL == 3,
CPSR 0x60000045 has EL == 1.
Got it! Thanks a lot!