Hi, getMetadata(“dbg”) returns NULL for such a small program as follows: int main(){ char a[10], b[2]; if(a[0] != 0 && a[1] != 0){ strcpy(a, b); } return 0; } The compiling command is: llvm-gcc --emit-llvm -g -c ./src.c I also tried the solutions I found through Google: http://stackoverflow.com/questions/14943447/llvm-line-number-of-an-instruction http://stackoverflow.com/questions/23089316/getmetadatadbg-returns-null-despite-producing-ir-with-clang-g-s-emit-llv but neither of them works. Does anyone have any idea about this? Thanks, Yongchao. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140424/4b396886/attachment.html>
On Thu, Apr 24, 2014 at 1:42 AM, 李永超 <lyc364 at gmail.com> wrote:> Hi, > getMetadata(“dbg”) returns NULL for such a small program as follows: > > > int main(){ > char a[10], b[2]; > if(a[0] != 0 && a[1] != 0){ > strcpy(a, b); > } > return 0; > } > > The compiling command is: llvm-gcc --emit-llvm -g -c ./src.cllvm-gcc is dead and unmaintained. Try clang?> > I also tried the solutions I found through Google: > http://stackoverflow.com/questions/14943447/llvm-line-number-of-an-instruction > http://stackoverflow.com/questions/23089316/getmetadatadbg-returns-null-despite-producing-ir-with-clang-g-s-emit-llv > > but neither of them works. > > Does anyone have any idea about this? > Thanks, > Yongchao. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Neither of the solutions you found uses llvm-gcc. On Thu, Apr 24, 2014 at 11:42 AM, 李永超 <lyc364 at gmail.com> wrote:> Hi, > getMetadata(“dbg”) returns NULL for such a small program as follows: > > > int main(){ > char a[10], b[2]; > if(a[0] != 0 && a[1] != 0){ > strcpy(a, b); > } > return 0; > } > > The compiling command is: llvm-gcc --emit-llvm -g -c ./src.c > > I also tried the solutions I found through Google: > > http://stackoverflow.com/questions/14943447/llvm-line-number-of-an-instruction > http://stackoverflow.com/questions/23089316/getmetadatadbg-returns-null- > despite-producing-ir-with-clang-g-s-emit-llv > > but neither of them works. > > Does anyone have any idea about this? > Thanks, > Yongchao. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Mingliang LIU (刘明亮 in Chinese) PACMAN Group, Tsinghua University Email: liuml07 at mails.tsinghua.edu.cn Homepage: http://pacman.cs.tsinghua.edu.cn/~liuml07/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140424/346291ee/attachment.html>
As David said llvm-gcc is dead. Is there a reason you are using llvm-gcc (and consequently LLVM <= 2.9)? Are you by chance trying to use KLEE [1]? I think I've seen your e-mail on the klee mailing list before. If you are using KLEE you should in bear in mind that KLEE does build against LLVM3.4 and works fine with Clang, not everything works yet but it is pretty usable. You are more likely to get a positive response from developers if you use a version of LLVM that isn't >= 3 years old. [1] http://klee.github.io/klee/ -- Dan Liew PhD Student - Imperial College London