<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">2013/10/11 Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="im">On 11 October 2013 10:42, Anton Smirnov <span dir="ltr"><<a href="mailto:dev@antonsmirnov.name" target="_blank">dev@antonsmirnov.name</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>10-11 15:35:15.473: ERROR/CLANG_DEBUG(2491): parsing: index=0xbeb06704 filename=./testfile.cpp args_count=0 files_count=1</div>


<div>        file=./testfile.cpp</div></div></div></blockquote><div><br></div></div><div>So, here, the object address was correct, in the array.</div><div class="im"><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div><div>// oops, where is filename ? (probably CXIndex at 0xbeb06704 is corrupted for some reason)<br></div><div>10-11 15:35:15.503: ERROR/CLANG_DEBUG(2491): after parse filename: []</div></div></div></blockquote>

<div><br></div></div><div>Is this from another call? Can you print the address/contents of the array?</div></div></div></div></blockquote><div><br></div><div>yes, index instance address is within <>:</div><div><span style="font-family:arial,sans-serif;font-size:13px">10-11 15:35:15.473: ERROR/CLANG_DEBUG(2491): <0x6564805c> hold to index=0 (0x6564805c) -> 0xbeb06704</span><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote"><div> It might be that the array is pointing to the wrong place, or the array's own address has somehow changed, thus it's not CXIndex that is corrupted, but the array representation.</div>
</div></div></div></blockquote><div><br></div><div>no, the same array pointer after unmap (after passing long from java to native code):</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">10-11 15:35:15.473: ERROR/CLANG_DEBUG(2491): <0x6564805c> get from index=0 (0x6564805c) -> 0xbeb06704</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">if array pointer is different then array[0] will be different most likely, but it's exactly the same:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">0xbeb06704</span><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>
<div>// pack translation unit and return index to java<br></div><div>10-11 15:35:15.503: ERROR/CLANG_DEBUG(2491): hold translationUnit to index=0 (0x656480dc) -> 0xbeb066c8</div></div></div></blockquote><div><br></div>

</div><div>Is this still the array? The address is different than you use to have earlier.</div></div></div></div></blockquote><div><br></div><div><span style="color:rgb(80,0,80)">0xbeb066c8 i</span>s CXTranslationUnit instance address, not CXIndex instance address. While parsing right index instance address is passed (<span style="font-size:13px;font-family:arial,sans-serif">index=0xbeb06704</span>):</div>
<div><div style="font-family:arial,sans-serif;font-size:13px">10-11 15:35:15.473: ERROR/CLANG_DEBUG(2491): parsing: index=0xbeb06704 filename=./testfile.cpp args_count=0 files_count=1</div><div style="font-family:arial,sans-serif;font-size:13px">
        file=./testfile.cpp</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>cheers,</div><div>--renato</div></div></div></div>
</blockquote></div><div class="gmail_extra"><br></div>My idea is not CXInstance pointer address is corrupted (it's exactly the same), but memory for this address.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
I can provide code output where all the clang invocations are done with one single native invocation and it works (tokens are found). </div><div class="gmail_extra"><br></div></div>