crashanalysis/crashanalyser/com.nokia.s60tools.crashanalyser.help/html/reference/registers.htm
changeset 0 5ad7ad99af01
child 4 615035072f7e
equal deleted inserted replaced
-1:000000000000 0:5ad7ad99af01
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
       
     2 <html>
       
     3 <head>
       
     4 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
       
     5 <title>Registers</title>
       
     6 <link href="../../book.css" type="text/css" rel="stylesheet">
       
     7 </head>
       
     8 <body>
       
     9 
       
    10 <h2>Registers</h2>
       
    11 <p>When a crash occurs, the processor state is captured and stored to a crash file. For more information on Symbian OS and ARM registers, see the reference links (ARM Architecture Manuals and Symbian OS Internals) in the end of this topic.</p>
       
    12 <p>In Crash Analyser, the register values at the time of the crash are partitioned into discrete processor modes that closely mirror the ARM architecture.</p><p>The following ARM processor modes are supported:</p>
       
    13 <table width="667" border="1" cellspacing="1" cellpadding="2">
       
    14 <colgroup>
       
    15 <col width="50*">
       
    16 <col width="141*"></colgroup>
       
    17 <thead>
       
    18 <tr>
       
    19 <td><b>Name</b></td>
       
    20 <td><b>Description</b></td>
       
    21 </tr>
       
    22 </thead>
       
    23 <tbody>
       
    24 <tr>
       
    25 <td>User</td>
       
    26 <td> Contains registers associated with the processor whilst it was executing in USER mode. This is the normal execution mode for ARM processors.</td>
       
    27 </tr>
       
    28 <tr>
       
    29 <td>Fast Interrupt (FIQ)</td>
       
    30 <td>Registers that are associated with ARM FIQ mode, a privileged mode in which is used for high speed low latency interrupt handling.</td>
       
    31 </tr>
       
    32 <tr>
       
    33 <td>Interrupt (IRQ)</td>
       
    34 <td>General purpose ARM interrupt handling mode.</td>
       
    35 </tr>
       
    36 <tr>
       
    37 <td>Supervisor </td>
       
    38 <td>Registers that are associated with code executing within the context of the Symbian OS kernel. </td>
       
    39 </tr>
       
    40 <tr>
       
    41 <td>Abort</td>
       
    42 <td>Typically used when the processor was unable to access a memory area.</td>
       
    43 </tr>
       
    44 <tr>
       
    45 <td>Undefined</td>
       
    46 <td>Indicates that the processor could not interpret an instruction.</td>
       
    47 </tr>
       
    48 <tr>
       
    49 <td>System</td>
       
    50 <td>Not used in Symbian OS.</td>
       
    51 </tr>
       
    52 </tbody>
       
    53 </table>
       
    54 
       
    55 <p>Additionally the ARM banks are supplemented by:</p>
       
    56 <table width="667" border="1" cellspacing="1" cellpadding="2">
       
    57 <colgroup>
       
    58 <col width="50*">
       
    59 <col width="141*"></colgroup>
       
    60 <thead>
       
    61 <tr>
       
    62 <td><b>Name</b></td>
       
    63 <td><b>Description</b></td>
       
    64 </tr>
       
    65 <tr>
       
    66 <td>Exception</td>
       
    67 <td>Contains exception-specific registers, such as the exception code relevant to the exception that occurred.</td>
       
    68 </tr>
       
    69 <tr>
       
    70 <td>Co-processor</td>
       
    71 <td>Contains co-processor registers, such as the fault status register.</td>
       
    72 </tr>
       
    73 </thead>
       
    74 <tbody>
       
    75 <tr>
       
    76 <td></td>
       
    77 <td></td>
       
    78 </tr>
       
    79 </tbody>
       
    80 </table>
       
    81 
       
    82 <p>The ARM register modes typically support a register range of R00 to R15. R13, R14 and R15 have special meaning:</p>
       
    83 <table width="667" border="1" cellspacing="1" cellpadding="2">
       
    84 <colgroup>
       
    85 <col width="50*">
       
    86 <col width="141*"></colgroup>
       
    87 <thead>
       
    88 <tr>
       
    89 <td><b>Name</b></td>
       
    90 <td><b>Description</b></td>
       
    91 </tr>
       
    92 <tr>
       
    93 <td>R13</td>
       
    94 <td>Current stack pointer. Adjusted as data is pushed and popped from the stack. </td>
       
    95 </tr>
       
    96 </thead>
       
    97 <tbody>
       
    98 <tr>
       
    99 <td>R14</td>
       
   100 <td>Otherwise known as the link register (LR). Contains the address of the instruction to branch to after returning from a subroutine. Can also contain the address to return to after the processor enters an exception mode (for example Abort, Supervisor, FIQ, IRQ etc).</td>
       
   101 </tr>
       
   102 <tr>
       
   103 <td>R15</td>
       
   104 <td>Register 15 is the Program Counter (PC). It can be used in most instructions as a pointer to the instruction which is two instructions after the instruction being executed.</td>
       
   105 </tr>
       
   106 </tbody>
       
   107 </table>
       
   108 
       
   109 <p>Additionally, some register values are preserved when the processor transitions from one execution mode to another (for example, when the process transitions from User to Supervisor mode in order to fulfill a privileged operation). Full details about this preservation or &ldquo;banking&rdquo; are described in ARM Architecture Manuals. See the link below.</p>
       
   110 <p>Finally, the CPSR, or Current Program Status Register is also noteworthy. It is one of several Status Registers that is used to hold details about the current state of the processor at the time of a crash. For example, it can indicate if the processor was executing an ARM or THUMB instruction, or whether interrupts were disabled. Most critically, it describes the execution mode of the processor at the time of the panic/exception &ndash; for example, did the exception occur whilst the processor was executing kernel code (Supervisor Mode) or user code (User Mode)?</p>
       
   111 <p>Function call arguments are typically passed to the function within register values (were possible, depending on argument type and number of arguments). If a function signature contains too many arguments then the registers may be supplemented by the stack (arguments are pushed on the stack by the function caller and popped of the stack by the function itself). Typically R00 to R03 are used for function passing.</p>
       
   112 <p> Additionally, R00 is often utilized as the &ldquo;this&rdquo; pointer when performing method dispatch on an object. A common related problem can be de-referencing a null this pointer or then de-referencing a deleted object in order to invoke a method. Both issues can often be identified based upon the value of the program counter (R15) and the value of R00 (for example is it 0x00000000).</p>
       
   113 <p>For reference information, see the following references:</p>
       
   114 <ul>
       
   115 <li>ARM EABI: <a href="http://www.arm.com/products/DevTools/ABI.html"> http://www.arm.com/products/DevTools/ABI.html</a></li>
       
   116 <li>ARM Architecture Manuals: <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/ http://www.arm.com/pdfs/ARMv6_Architecture.pdf">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/ http://www.arm.com/pdfs/ARMv6_Architecture.pdf</a></li>
       
   117 <li>Symbian OS Internals: <a href="http://www.amazon.com/Symbian-OS-Internals-Real-time-Programming/dp/0470025247">http://www.amazon.com/Symbian-OS-Internals-Real-time-Programming/dp/0470025247</a></li>
       
   118 </ul>
       
   119 
       
   120 <div id="footer">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
       
   121 License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
       
   122 </body>
       
   123 </html>