<div dir="ltr">Neither of the solutions you found uses llvm-gcc.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 24, 2014 at 11:42 AM, 李永超 <span dir="ltr"><<a href="mailto:lyc364@gmail.com" target="_blank">lyc364@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div>getMetadata(“dbg”) returns NULL for such a small program as follows:</div><div><br></div><div><br></div>
<div><div>int main(){</div><div><span style="white-space:pre-wrap"> </span>char a[10], b[2];</div><div><span style="white-space:pre-wrap"> </span>if(a[0] != 0 && a[1] != 0){</div><div><span style="white-space:pre-wrap"> </span>strcpy(a, b);</div>
<div><span style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span>return 0;</div><div>}</div></div><div><br></div><div>The compiling command is: <span style="line-height:1.5"> llvm-gcc --emit-llvm -g -c ./src.c</span></div>
<div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">I also tried the solutions I found through Google:</span></div><div><a href="http://stackoverflow.com/questions/14943447/llvm-line-number-of-an-instruction" target="_blank">http://stackoverflow.com/questions/14943447/llvm-line-number-of-an-instruction</a></div>
<div><a href="http://stackoverflow.com/questions/23089316/getmetadatadbg-returns-null-despite-producing-ir-with-clang-g-s-emit-llv" style="outline:none;color:rgb(10,55,97);font-family:'lucida Grande',Verdana;line-height:23px" target="_blank">http://stack<u></u>overflow.com<u></u>/questions/2<u></u>3089316/getm<u></u>etadatadbg-r<u></u>eturns-null-<u></u>despite-prod<u></u>ucing-ir-wit<u></u>h-clang-g-s-<u></u>emit-llv</a></div>
<div><br></div><div>but neither of them works. </div><div><br></div><div>Does anyone have any idea about this?</div><div>Thanks,</div><div>Yongchao.</div><div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)" color="#666666">Mingliang LIU (刘明亮 in Chinese)<br><br>PACMAN Group, Tsinghua University<br>
Email: <a href="mailto:liuml07@mails.tsinghua.edu.cn" target="_blank">liuml07@mails.tsinghua.edu.cn</a></font><div><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)" color="#666666">Homepage: <a href="http://pacman.cs.tsinghua.edu.cn/~liuml07" style="line-height:19px;text-align:center" target="_blank">http://pacman.cs.tsinghua.edu.cn/~liuml07/</a></font></div>
</div>
</div>