<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/developer/ip-products/processors/f/cortex-a-forum/48013/debug-using-gdb-debugger-how-to-get-the-exception-level</link><description> I&amp;#39;m debugging the ARM Cortex A53 on the QEMU emulator using gdb debugger, any idea on how to get what exception level I&amp;#39;m running on (EL3/2/1/0) ? </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168558?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 09:07:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ed3e2ff5-214c-4e35-8d5f-5066c85489c1</guid><dc:creator>Boon Khai</dc:creator><description>&lt;p&gt;Hi Vstehle,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Got it! Thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168557?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 08:48:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:482b466e-8b9b-41ef-9ef3-24b9752600b5</guid><dc:creator>vstehle</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/boon-khai" class="internal-link view-user-profile"&gt;Boon Khai&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;gdb gets EL from&amp;nbsp;&lt;a href="https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/features/aarch64-core.c;h=a080a641c45f55cb020f85da5411475c1d13ac44;hb=HEAD"&gt;CPSR bits 3:2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(See also&amp;nbsp;&lt;a href="https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/spsr_el1"&gt;SPSR_EL1.M[3:2]&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;CPSR 0x400003cd has indeed EL == 3,&lt;/p&gt;
&lt;p&gt;CPSR 0x60000045 has EL == 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168553?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 03:01:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ef49535b-6e4f-4b40-b005-3b839ff932e3</guid><dc:creator>Boon Khai</dc:creator><description>&lt;p&gt;Hi Vstehle,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m able to dump out the cpsr register, but&amp;nbsp;I don&amp;#39;t have the decoded register value like yours in the square bracket, referring to the document you shared, I don&amp;#39;t find any bit specifying the Exception Level, only the NZVC APSR, etc...&lt;/p&gt;
&lt;p&gt;Here is my cpsr at EL3 (i guess)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/10/pastedimage1604977078725v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;And here is my cpsr at EL0 (i guess, because it is now running the baremetal application)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/10/pastedimage1604977277498v2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168547?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 16:21:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5b641583-b968-4e80-afd4-f066feea8b39</guid><dc:creator>vstehle</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/boon-khai" class="internal-link view-user-profile"&gt;Boon Khai&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;In gdb the PSTATE is available as &lt;a href="https://developer.arm.com/documentation/den0013/d/ARM-Processor-Modes-and-Registers/Registers/Program-Status-Registers?lang=en"&gt;CPSR&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;(gdb) info registers
x0             0x1                 1
...
cpsr           0x60000000          [ EL=0 C Z ]
...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168543?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 15:29:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:190961bc-510d-4db9-948f-6200770e55d7</guid><dc:creator>Boon Khai</dc:creator><description>&lt;p&gt;HI Bastian,&lt;/p&gt;
&lt;p&gt;i&amp;#39;m aware of the CurrentEL register, but somehow I&amp;#39;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,&amp;nbsp;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.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/10/pastedimage1604935662428v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168541?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 15:13:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:13ba1cef-d482-4edb-83c7-9253979561d4</guid><dc:creator>42Bastian Schick</dc:creator><description>&lt;p&gt;Check the system register &amp;quot;CurrentEL&amp;quot; (DDI0487Fc , chapter C5.2.1)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168540?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 14:42:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8cff4174-c727-4766-9456-40faf8a3929e</guid><dc:creator>Boon Khai</dc:creator><description>&lt;p&gt;Okay, thanks Oliver.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug using gdb debugger, how to get the exception level?</title><link>https://community.arm.com/thread/168539?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 14:37:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b7e7822b-2f34-4b3a-9cec-f20d6d27dfb6</guid><dc:creator>Oliver Beirne</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/boon-khai" class="internal-link view-user-profile"&gt;Boon Khai&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have moved your question to the Cortex-A forum, where someone may be able to help you.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Oli from the Community team&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>