<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>CodeWarrior Development ToolsのトピックRe: Codewarrior IDE doesn't track some function parameters</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664332#M5920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;William.&lt;/P&gt;&lt;P&gt;Thanks! This problem is escalated as defect to development team (ENGR0085401)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for bringing the problem to our attention.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2016 06:45:42 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2016-10-28T06:45:42Z</dc:date>
    <item>
      <title>Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664327#M5915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developing code with Codewarrior for the NXP DSC, the MC56F82748VLH to be precise.&amp;nbsp;&amp;nbsp; One function call has&amp;nbsp;7 parameters passed to it.&amp;nbsp;&amp;nbsp; Inside a C&amp;nbsp;function the local parameters are all stored on the stack (some call it the heap).&amp;nbsp; They are accessed as (SP-6), (SP-4)&amp;nbsp;for example, where SP = stack pointer and brackets denote indirection.&amp;nbsp; When a function is called the arguments are written to registers and SP increased to reserve room for the local variables in the function and the return address.&amp;nbsp;&amp;nbsp; If there are more than&amp;nbsp;6 arguments the extra ones&amp;nbsp;are pushed onto the stack before the function call.&amp;nbsp;&amp;nbsp; Inside the called function those arguments are directly read from the stack location the were written to before the call.&amp;nbsp; So if&amp;nbsp;argument&amp;nbsp;7&amp;nbsp;is pushed on the stack and the&amp;nbsp;function is called, SP is incremented by 2.&amp;nbsp; Inside the called function&amp;nbsp;SP is increased again to reserve space for local variables.&amp;nbsp;&amp;nbsp; If 16 is added to SP to&amp;nbsp;allocate room for local variables,&amp;nbsp;argument&amp;nbsp;7 would be accessed inside the called function as (SP-0x12).&amp;nbsp;&amp;nbsp;&amp;nbsp; This is apparent from looking at the stack, the processor registers, and the disassembly of the program.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have seen however is that when the program is inside the called function where&amp;nbsp;argument&amp;nbsp;7 is located at (SP-0x12),&amp;nbsp;the IDE displays (SP) for this same parameter.&amp;nbsp;&amp;nbsp; I see this when the cursor hovers over the variable name or if I open up the variable window.&amp;nbsp;&amp;nbsp; If I modify location (SP) in a memory window I see the IDE display for&amp;nbsp;argument&amp;nbsp;7 change.&amp;nbsp;&amp;nbsp; The program is executing the code correctly but the IDE is not adding in the stack&amp;nbsp;offset for arguments that have been pushed on the stack in a function call.&amp;nbsp;&amp;nbsp;&amp;nbsp; This only happens if&amp;nbsp;7 (or possibly more) arguments are passed in a function.&amp;nbsp;&amp;nbsp;&amp;nbsp; I have not tried it with&amp;nbsp;8 or more.&amp;nbsp;&amp;nbsp; I have tried it with&amp;nbsp;6 arguments by making argument&amp;nbsp;7 a global in the function call and then assigning that value to a local inside the called function.&amp;nbsp; In that case of course the IDE displays the parameter values correctly and the program runs correctly.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an IDE bug that most would not see, since it doesn't make the program execute incorrectly and only occurs when more than&amp;nbsp;6 arguments are passed to a function.&amp;nbsp;&amp;nbsp; Codewarrior doesn't have a mixed (C + asm) debug mode with JTAG&amp;nbsp;or many compile options so there does not appear to be any work-around for this IDE display bug.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2016 23:26:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664327#M5915</guid>
      <dc:creator>williamogilvie</dc:creator>
      <dc:date>2016-10-24T23:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664328#M5916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To investigate your problem correctly and efficiently, please provide us the follows:&lt;BR /&gt;1.&amp;nbsp;&amp;nbsp; &amp;nbsp;your CW version: &lt;BR /&gt;&amp;nbsp; - if you use classic version: Start the IDE and click on Help | About Freescale CodeWarrior. Click on Installed Products.Save all info displayed into a txt file and send it to me.&lt;BR /&gt;&amp;nbsp; - if you use eclipse version: Start the IDE and click on Help | About CodeWarrior Development Studio. Send me the version and build id.&lt;BR /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; upload the entire sample code folder in zip format here thus we can test it on my side directly.&lt;BR /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error screenshot.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 09:14:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664328#M5916</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-10-26T09:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664329#M5917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Codewarrior version 10.6&amp;nbsp;&amp;nbsp; Build ID:140329&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We cannot send our code.&amp;nbsp; You will have to write some functions yourself to reproduce the problem.&amp;nbsp;&amp;nbsp; All that is required is a function with 7 or more arguments and a call to that function from Main.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no error message.&amp;nbsp;&amp;nbsp;&amp;nbsp; The IDE displays the wrong values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 15:48:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664329#M5917</guid>
      <dc:creator>williamogilvie</dc:creator>
      <dc:date>2016-10-26T15:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664330#M5918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I did a quick test from my side.&lt;/P&gt;&lt;P&gt;run code to the cursor in debugger as below. in variable window, a5-a7 shows incorrect. Is it your problem?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/7167i3467F5ECF1FFE5D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 07:25:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664330#M5918</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-10-27T07:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664331#M5919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EDIT**&amp;nbsp; I took another look at&amp;nbsp;your example and although the processor is different your example does show the same IDE bug I saw.&amp;nbsp;&amp;nbsp; In your case the last 3&amp;nbsp;local variables&amp;nbsp;have the wrong value.&amp;nbsp;&amp;nbsp;&amp;nbsp;The other problem I see is that some of your local variables have the same address as the arguments of the function.&amp;nbsp; That would be a compiler problem if it is not another example of the&amp;nbsp;IDE display bug.&amp;nbsp;&amp;nbsp;&amp;nbsp; If you look at the disassembly code (I am using an MC56F82748VLH.&amp;nbsp; There is no guarantee the problem will occur for a different processor), the last operand, a7, is pushed on the stack.&amp;nbsp;&amp;nbsp; If it was copied to register A earlier then you will see this instruction:&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w A, X:(SP).&amp;nbsp;&amp;nbsp; Later 2+&amp;lt;N=number of local variables&amp;gt; is added to SP.&amp;nbsp;&amp;nbsp; The disassembly of the called function will show this but any IDE display of that parameter will access it at X:(SP) instead of X:(SP - 2 - N).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 16:50:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664331#M5919</guid>
      <dc:creator>williamogilvie</dc:creator>
      <dc:date>2016-10-27T16:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664332#M5920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;William.&lt;/P&gt;&lt;P&gt;Thanks! This problem is escalated as defect to development team (ENGR0085401)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for bringing the problem to our attention.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 06:45:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664332#M5920</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-10-28T06:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior IDE doesn't track some function parameters</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664333#M5921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am happy to be of help.&amp;nbsp;&amp;nbsp;&amp;nbsp; It looks like you were able to duplicate the problem easily so the fix should be easy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 18:19:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-IDE-doesn-t-track-some-function-parameters/m-p/664333#M5921</guid>
      <dc:creator>williamogilvie</dc:creator>
      <dc:date>2016-10-28T18:19:02Z</dc:date>
    </item>
  </channel>
</rss>

