Adaptation/GUID-DA62FD4F-2E74-5B2F-B703-4A40DF5F01CA.dita
changeset 15 307f4279f433
equal deleted inserted replaced
14:578be2adaf3e 15:307f4279f433
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-DA62FD4F-2E74-5B2F-B703-4A40DF5F01CA" xml:lang="en"><title>MAKSYM
       
    13 Tool</title><shortdesc>MAKSYM is a command line tool that processes the log file generated
       
    14 when building a ROM image, and creates a text file that lists the address
       
    15 of every global and exported function in the ROM</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    16 <p> <xref href="GUID-CC04A14B-A839-5613-820D-F1E65EB2DF7F.dita">Reference: tools:
       
    17 MAKSYM</xref> outlines the syntax of the command. </p>
       
    18 <p>If you know the address of the instruction which caused an exception, you
       
    19 can compare this address with the MAKSYM log to see which function this is
       
    20 in. You can narrow this down to the exact code within the function by using <codeph>ABLD
       
    21 LISTING</codeph> to get the assembler output from the compiler. </p>
       
    22 <p>The following example MAKSYM log is taken from an EKA1 build; however,
       
    23 the principle is the same for EKA2. </p>
       
    24 <codeblock id="GUID-D59F2E58-C39A-516B-8185-F4C8DBB9BE45" xml:space="preserve">From    \Epoc32\Release\Misa\UREL\ekern.exe
       
    25 
       
    26 50003040    0094    _E32Startup
       
    27 500030d4    002c    ImpDma::Init1(void)
       
    28 50003100    0004    ImpDma::Init3(void)
       
    29 50003104    0008    ImpDma::MaxBlockSize(void)
       
    30 </codeblock>
       
    31 <p>If, for example, the code address of the exception is at <codeph>0x500030dc</codeph>,
       
    32 then you can see from the log that this is in the <codeph>ImpDma::Init1()</codeph> function,
       
    33 at offset 8 from the start of the function. This function is in the file <filepath>...\e32\ekern\epoc\arm\sa1100\ka_dma.cpp</filepath>,
       
    34 so use<codeph> ABLD LISTING</codeph> to obtain the assembler: </p>
       
    35 <p><userinput>cd \e32</userinput> </p>
       
    36 <p><userinput>abld listing misa urel ekern ka_dma </userinput> </p>
       
    37 <p>Notice that you must specify the component that the file is part of, in
       
    38 this case <codeph>EKERN</codeph>, and that you do not put the <filepath>.cpp</filepath> extension
       
    39 on the source file name. If you do not specify a source file ABLD will create
       
    40 an assembler listing for every file in component <codeph>EKERN</codeph>. </p>
       
    41 <p>The listing file will be placed in the same directory as <codeph>ka_dma.cpp</codeph>,
       
    42 and will be called <codeph>ka_dma.lis</codeph>. If you look at this file you
       
    43 will see something like this: </p>
       
    44 <codeblock id="GUID-285B04C6-E2C4-5A62-A47B-C31F71231F57" xml:space="preserve">7                  Init1__6ImpDma:
       
    45    8                      @ args = 0, pretend = 0, frame = 0
       
    46    9                      @ frame_needed = 0, current_function_anonymous_args = 0
       
    47   10                      @ I don't think this function clobbers lr
       
    48   11 0000 18209FE5         ldr    r2, .L793
       
    49   12 0004 0630A0E3         mov    r3, #6
       
    50   13 0008 003082E5         str    r3, [r2, #0]
       
    51   14 000c 10309FE5         ldr    r3, .L793+4
       
    52   15 0010 10009FE5         ldr    r0, .L793+8
       
    53   16 0014 000083E5         str    r0, [r3, #0]
       
    54   17 0018 1810A0E3         mov    r1, #24
       
    55   18 001c FEFFFFEA         b    FillZ__3MemPvi
       
    56 </codeblock>
       
    57 <p>Offset 8 is the first STR instruction. Comparing this with the C++ source: </p>
       
    58 <codeblock id="GUID-695798DA-4A00-5963-A3B8-F30D5D908FDA" xml:space="preserve">void ImpDma::Init1()
       
    59 //
       
    60 // Phase 1 initialisation of the Dma channels
       
    61 //
       
    62     {
       
    63     PP::DmaMaxChannels=KNumberOfDmaChannels;
       
    64     PP::DmaChannelTable=(TDma **)(&amp;DmaChannels[0]);
       
    65     Mem::FillZ(PP::DmaChannelTable,sizeof(TDma *)*KNumberOfDmaChannels);
       
    66     }
       
    67 </codeblock>
       
    68 <p>The first store is to PP::DmaMaxChannels, so clearly there is a problem
       
    69 writing this memory. </p>
       
    70 </conbody></concept>