Hi, I am new to LLVM, and need to find the line number and cpp source file name for each instruction in a .bc file. I suppose llvm debugger might have that feature but there is no documentation on it. Would you please give me some help how to do it? Thanks, ::Saman Zonouz University of Illinois -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090709/fdb2b693/attachment.html>
> -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]On> Behalf Of Saman Aliari Zonouz > Sent: Thursday, July 09, 2009 11:44 AM > To: llvmdev at cs.uiuc.edu > Subject: [LLVMdev] Source file information. > > Hi, > > I am new to LLVM, and need to find the line number and cpp source file > name for each instruction in a .bc file. I suppose llvm debugger might > have that feature but there is no documentation on it. Would youplease> give me some help how to do it? >Compile the original .cpp file with clang -g option. The file/line is maintained in SDNodes with DebugLoc field. - Sanjiv> Thanks, > ::Saman Zonouz > University of Illinois
>> -----Original Message----- >> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On >> Behalf Of Saman Aliari Zonouz >> Sent: Thursday, July 09, 2009 11:44 AM >> To: llvmdev at cs.uiuc.edu >> Subject: [LLVMdev] Source file information. >> >> Hi, >> >> I am new to LLVM, and need to find the line number and cpp source file >> name for each instruction in a .bc file. I suppose llvm debugger might >> have that feature but there is no documentation on it. Would you > please >> give me some help how to do it? >> > Compile the original .cpp file with clang -g option. > The file/line is maintained in SDNodes with DebugLoc field.Can you also get this information in LLVM ? And what about with llvm-gcc ? Many thanks in advance, Aaron
Thanks for your reply. Is it not possible to do with llvm-g++ -g? and furthermore, where are SDNode and DebugLoc fields stored? are they in a file which I have to parse myself? if so, is there any way that I use a library to get the file/line information for each instruction? since, I am writing a pass for opt tool that manipulates the callgraph and want to get the line number information in runOnModule() function. Thanks, ::Saman On Thu, Jul 9, 2009 at 8:13 AM, Saman Aliari Zonouz <saliari2 at uiuc.edu>wrote:> Hi, > > I am new to LLVM, and need to find the line number and cpp source file name > for each instruction in a .bc file. I suppose llvm debugger might have that > feature but there is no documentation on it. Would you please give me some > help how to do it? > > Thanks, > ::Saman Zonouz > University of Illinois >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090709/c28b6bdf/attachment.html>
Thanks for your reply. Is it not possible to do with llvm-g++ -g? Yes and furthermore, where are SDNode and DebugLoc fields stored? They are probably classes in the Clang API are they in a file which I have to parse myself? if so, is there any way that I use a library to get the file/line information for each instruction? Yes Clang API :- http://clang.llvm.org/doxygen/classes.html http://llvm.org/viewvc/llvm-project/cfe/trunk/ since, I am writing a pass for opt tool that manipulates the callgraph and want to get the line number information in runOnModule() function. Thats LLVM, as Edwin says "See Analysis/DebugInfo.h, and opt -print-dbginfo for an example of how to use it." http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?revision=74920&view=markup http://llvm.org/doxygen/classes.html#letter_D Anyway theres some pointers, Aaron Thanks, ::Saman On Thu, Jul 9, 2009 at 8:13 AM, Saman Aliari Zonouz <saliari2 at uiuc.edu> wrote: Hi, I am new to LLVM, and need to find the line number and cpp source file name for each instruction in a .bc file. I suppose llvm debugger might have that feature but there is no documentation on it. Would you please give me some help how to do it? Thanks, ::Saman Zonouz University of Illinois ------------------------------------------------------------------------------ _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090709/2516ce19/attachment.html>
Thanks a lot for the helpful info. Devang, I need line number information for a project in which we want to find a feasible path through an application based on some bug-signature that is given. And the signature includes line number info for the frames on stack. One Q regarding the mailing list: I have subscribed the list but still don't receive the mails. Could someone please let me know why? Thanks a lot, ::Saman -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090710/16df9002/attachment.html>