similar to: [LLVMdev] DebugInfo from LLVM Instruction

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] DebugInfo from LLVM Instruction"

2010 Jul 07
2
[LLVMdev] source line number for instruction
Hi, I found the following at http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend: if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM instruction DILocation Loc(N); // DILocation is in DebugInfo.h unsigned Line = Loc.getLineNumber(); StringRef File = Loc.getFilename(); StringRef Dir = Loc.getDirectory(); } Does this also
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Török Edwin wrote: > On 03/16/2010 05:00 PM, John Criswell wrote: > >> Dear LLVMers, >> >> I'm updating some code to use the new LLVM 2.7 API. One piece of this >> code uses the findStopPoint() function to find the source filename and >> line number information of an instruction. >> >> What is the best way to do this under LLVM 2.7 now that
2010 Jul 07
0
[LLVMdev] source line number for instruction
On Jul 6, 2010, at 10:44 PM, Guoliang Jin wrote: > I found the following at http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend > : > if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM > instruction > DILocation Loc(N); // DILocation is in > DebugInfo.h > unsigned Line = Loc.getLineNumber(); > StringRef
2014 Jan 24
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
Thanks Eric, but could you give me a little bit more hints or pointers please? I looked into DebugInfo.h, but I'm still not sure how to start. It sounds like I'd have to somehow manually extract metadata nodes from an instruction. Thanks, JS On Wed, Jan 22, 2014 at 10:14 PM, Eric Christopher <echristo at gmail.com>wrote: > This is likely going to be difficult if possible. I
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Dear LLVMers, I'm updating some code to use the new LLVM 2.7 API. One piece of this code uses the findStopPoint() function to find the source filename and line number information of an instruction. What is the best way to do this under LLVM 2.7 now that the stop point intrinsic has been removed? It appears that the debug information is attached as metadata, but what is the easiest way
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Török Edwin wrote: > [snip] >>> Something like this (you can of course cache TheMetadata and MDDbgKind) >>> >>> llvm::MetadataContext *TheMetadata = M->getContext().getMetadata(); >>> MDDbgKind = TheMetadata->getMDKind("dbg"); >>> if (MDDbgKind) { >>> if (MDNode *Dbg = TheMetadata->getMD(MDDbgKind, I)) { >>>
2014 Jan 23
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
Hi, I have bitcode files built by LLVM v3.3 and need to process them using v3.4 tools. While I don't expect a lot of backward compatibility in LLVM, luckily it seems everything's working fine, except for reading source line information attached to instructions. I use this piece of code [0] to get source line information. For v3.4, instruction.getMetadata returns NULL. I used llvm-dis to
2010 Mar 16
0
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
On 03/16/2010 05:00 PM, John Criswell wrote: > Dear LLVMers, > > I'm updating some code to use the new LLVM 2.7 API. One piece of this > code uses the findStopPoint() function to find the source filename and > line number information of an instruction. > > What is the best way to do this under LLVM 2.7 now that the stop point > intrinsic has been removed? It
2010 Mar 16
0
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
On 03/16/2010 05:21 PM, John Criswell wrote: > Török Edwin wrote: >> On 03/16/2010 05:00 PM, John Criswell wrote: >> >>> Dear LLVMers, >>> >>> I'm updating some code to use the new LLVM 2.7 API. One piece of >>> this code uses the findStopPoint() function to find the source >>> filename and line number information of an
2010 Feb 09
3
[LLVMdev] Mapping bitcode to source code
On Feb 8, 2010, at 8:51 PM, Duncan Sands wrote: > this can be done using debug info. Check out > http://llvm.org/docs/SourceLevelDebugging.html Wow, that threw me for a loop. I'm using the 2.6 release, thinking I was up to date, but its debug output doesn't look anything like what's described in the above link. It appears to document the upcoming 2.7 version, which
2010 Feb 09
0
[LLVMdev] Mapping bitcode to source code
On Feb 9, 2010, at 11:13 AM, Trevor Harmon wrote: > Is there any information about these changes and why they were > necessary? I think I found it: http://nondot.org/~sabre/LLVMNotes/EmbeddedMetadata.txt Still looking for an API to access the metadata... Trevor
2011 Mar 14
2
[LLVMdev] set line number debug info
Hi, I am new to LLVM infrastructure. Recently I am trying to set the debug info for an instruction. The main aim is to set the source line number of an instruction. Can anyone please show how to do that? I think that setMetadata method in Instruction class is to be used. But how do I create MDNode* consisting of desired source line number. Source line number can be extracted from the
2012 Oct 04
2
[LLVMdev] question
That's because instructions have a location associated with them, not a compile unit. -eric On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote: > I used DILocation instead of DICompileUnit and it works. Hmmm, interesting. > > George > > On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote: >> >> Here is
2013 Feb 18
1
[LLVMdev] llvm line number of an instruction
Hello everybody, I want to get the line number of an instruction (and also of a variable declaration - alloca and global). The instruction is saved in an array of instructions. I have the function:     Constant* metadata::getLineNumber(Instruction* I){         if (MDNode *N = I->getMetadata("dbg")) { // this if is never executed             DILocation Loc(N);             unsigned
2012 Feb 28
0
[LLVMdev] Getting corresponding c-instruction line number along with ir-instruction in a function's CFG
Hi I am not a good programmer but for my project i have to use llvm to generate CFG for c programs where i have a mapping from IR instruction in CFG to their respective c instruction. After surfing a in source of llvm i did the following change in printInstruction() function in llvm/lib/VMCore/AsmWriter.cpp file. .....void AssemblyWriter::printInstruction(const Instruction &I) { if
2011 Jul 08
0
[LLVMdev] How to get line number of a function in a bitcode file?
Hi Chen, On Jul 8, 2011, at 11:56 AM, kobe James wrote: > Hi All, > > I hope to get some information about functions in a bitcode file. Say, if we have a function foo(), and the bitcode file is generated by a single source file, then I want to get the line number foo() locates in that source file. > If the bitcode file is linked by multiple bitcode files, is it possible to also get
2011 Mar 14
0
[LLVMdev] set line number debug info
On Mon, Mar 14, 2011 at 8:56 AM, Abhirup Ghosh <abhirupju at gmail.com> wrote: > Hi, >       I am new to LLVM infrastructure. Recently I am trying to set the debug > info for an instruction. The main aim is to set the source line number of an > instruction. Can anyone please show how to do that? >       I think  that setMetadata method in Instruction class is to be used. >
2012 Oct 05
0
[LLVMdev] question
Hmmm, but it has a getDirectory function. -G On Thu, Oct 4, 2012 at 3:50 PM, Eric Christopher <echristo at gmail.com> wrote: > That's because instructions have a location associated with them, not > a compile unit. > > -eric > > On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote: > > I used DILocation instead of DICompileUnit and
2012 Oct 04
0
[LLVMdev] question
I used DILocation instead of DICompileUnit and it works. Hmmm, interesting. George On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote: > Here is the code. I am running on llvm 3.1 on Lion (Mac 10.7.4) > > *string getFileDirectory*(*const* Instruction &I){ > > MDNode *MD = I.getMetadata("dbg"); > > DICompileUnit
2012 Oct 05
1
[LLVMdev] question
You should probably think of the DIFooBar constructors like reinterpret-casts, not "go find the thing I actually want" functions. If you hand DICompileUnit() a node that is not a compile-unit metadata node, it's not going to tell you that you goofed. If you _did_ have a CU metadata node, then DICompileUnit's getDirectory() would work just fine. But you don't. --paulr