Note that there are some explanatory texts on larger screens.

plurals
  1. POVoid * parameter address shift
    primarykey
    data
    text
    <p>I am using Codewarrior 8.3 (IDE version 5.9) to program a 56f8367 DSC.</p> <p>I am using respected third party software, so I imagine that they know what they are doing and don't want to mess with their code too much, but they are playing around with passing void * parameters and it is something I am not totally familiar with.</p> <p>So I have this function:</p> <pre><code>static void T_CALLBACK _transmit( void *pContext, TX_DATA *pTxDescriptor) { CONTEXT *pLinkContext = (CONTEXT *)pContext; ... } </code></pre> <p>which is being called through a function pointer. When I stop the processor just before this function call, I can see the address pointed to by pContext is 0x1000, but after it is cast here, the address pointed to by pLinkContext is 0x0800. This, obviously causes problems because we start writing and reading from a different part of memory.</p> <p>There is something weird going on with the byte addressing/alignment where it is getting "shifted" over 1 bit. I see what is going wrong, I just don't understand why or, more importantly, how to solve the problem.</p> <p>What should I be looking for?</p> <p>(Editing to add the call per comment request) - although, I'm not sure how much it will help considering everything is buried in structures and is being called through a function pointer. I can say that "pTprtContext->tmw.pChannel->pLinkContext" is of a different type than CONTEXT, pLinkContext does match up with the beginning of CONTEXT, so I think they are just trying to insert it in there.</p> <pre><code>static void T_LOCAL _transmitNextFrame( D_CONTEXT *pTprtContext) { ... /* Transmit frame */ pTprtContext-&gt;t.pChannel-&gt;pLink-&gt;pLinkTransmit( pTprtContext-&gt;t.pChannel-&gt;pLinkContext, &amp;pTprtContext-&gt;linkTxDescriptor); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload