<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello Duncan,</span><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">I will try this alternative (I think that I already have </span><span style="font-family:arial,sans-serif;font-size:13px">enable-debug-symbols</span><span style="font-family:arial,sans-serif;font-size:13px">). However, it is not an easier way to add to an instruction an array of integers? Every element linked to one distinct operand. </span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">PS: I am afraid of rebuild LLVM since problems arose when I was trying to do that.</span></div>
<div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Thanks you for the answer !</span></div><div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><br style="font-family:arial,sans-serif;font-size:13px"><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 30, 2013 at 3:05 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alexandru, if these are LLVM Makefiles, then I suggest you configure and<br>
build LLVM with the options:<br>
<br>
  --disable-optimized --enable-assertions<br>
<br>
This will make debugging much easier.  It enables debug info too, which you can<br>
also turn on directly by configuring with --enable-debug-symbols.<br>
<br>
Ciao, Duncan.<div class="im"><br>
<br>
On 30/05/13 14:21, Alexandru Ionut Diaconescu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hello Duncan,<br>
<br>
Thank you for your quick answer. I use the standard Makefile from a pass, that<br></div>
is calling Makefile.common. I saw only the make -d option, that "*/print lots of<br>
debugging information/*", as mentioned by LLVM.<div class="im"><br>
<br>
Using this, valgrind don't tell me extra info. It is a very good idea ti use -g,<br>
but where to insert? If I am trying to use clang++, I have to fix a lot of<br>
things. Should I make the changes for to use clang++ or I can debug using the<br>
Makefile.common?<br>
<br>
<br>
On Thu, May 30, 2013 at 1:57 PM, Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a><br></div><div class="im">
<mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>> wrote:<br>
<br>
    Hi Alexandru,<br>
<br>
     > /*==5134== Invalid write of size 4<br>
<br>
        ==5134==    at 0x4039280: (anonymous<br></div>
        namespace)::Hello::__<u></u>runOnModule(llvm::Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/lib/Hello.so)<br>
        ==5134==    by 0x8E33DE3:<br>
        llvm::MPPassManager::__<u></u>runOnModule(llvm::Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/bin/opt)<br>
        ==5134==    by 0x8E3726F: llvm::PassManagerImpl::run(__<u></u>llvm::Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/bin/opt)<br>
        ==5134==    by 0x8E37385: llvm::PassManager::run(llvm::_<u></u>_Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/bin/opt)<div class="im"><br>
        ==5134==    by 0x41AE4D2: (below main) (libc-start.c:226)<br>
        ==5134==  Address 0x46cfa40 is 0 bytes after a block of size 200 alloc'd<br>
        ==5134==    at 0x402C454: operator new[](unsigned int) (in<br></div>
        /usr/lib/valgrind/vgpreload___<u></u>memcheck-x86-linux.so)<br>
        ==5134==    by 0x4037AE0: (anonymous<br>
        namespace)::Hello::__<u></u>runOnModule(llvm::Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/lib/Hello.so)*/<div class="im"><br>
<br>
        ==5134==  Address 0x46cfa40 is 0 bytes after a block of size 200 alloc'd<br>
        ==5134==    at 0x402C454: operator new[](unsigned int) (in<br></div>
        /usr/lib/valgrind/vgpreload___<u></u>memcheck-x86-linux.so)<br>
        ==5134==    by 0x4037AE0: (anonymous<br>
        namespace)::Hello::__<u></u>runOnModule(llvm::Module&) (in<br>
        /home/alex/llvm/Release+__<u></u>Asserts/lib/Hello.so)<div class="im"><br>
<br>
<br>
    you are writing of the end of an array that you allocated with "new".  If you<br>
    compile your program with debug info (-g) then valgrind should give you the line<br>
    number at which the allocation occurred and the line number at which the bad<br>
    write occurred.<br>
<br>
    Ciao, Duncan.<br>
<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Alexandru Ionut Diaconescu<br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Best regards,</font><br style="background-color:rgb(255,255,255);color:rgb(153,153,153)">
<font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div>