Sarah Thompson
2009-Apr-30 01:04 UTC
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
Hi folks, I had some code that used to work fine in earlier versions of LLVM, but is now failing. I have some code that expands DbgStopPointInst instructions to my own entry points in an opt pass, but it's currently failing to get the file name and path back, though it is still correctly getting line numbers. If you happen to have a code fragment that is known to work, it would be much appreciated. What it used to work was calling getFileName()->getNameStr() on the DbgStopPointInst, which returned a std::string, but in LLVM 2.5 the code compiles, but that string is empty. Any clues? [s]
Bill Wendling
2009-Apr-30 01:29 UTC
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
On Wed, Apr 29, 2009 at 6:04 PM, Sarah Thompson <sarah at findatlantis.com> wrote:> Hi folks, > > I had some code that used to work fine in earlier versions of LLVM, > but is now failing. I have some code that expands DbgStopPointInst > instructions to my own entry points in an opt pass, but it's currently > failing to get the file name and path back, though it is still > correctly getting line numbers. If you happen to have a code fragment > that is known to work, it would be much appreciated. >Hi Sarah, I'm not sure if this will help you out, but take a look at how DwarfWriter::getOrCreateSourceID is used. Unfortunately, I don't see how to get the file name from a DbgStopPointInstr right offhand. Things in the CodeGen/AsmPrinter/DwarfWriter.cpp file have changed quite a bit in recent months... -bw> What it used to work was calling getFileName()->getNameStr() on the > DbgStopPointInst, which returned a std::string, but in LLVM 2.5 the > code compiles, but that string is empty. Any clues? > > [s] > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Sarah Thompson
2009-Apr-30 01:43 UTC
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
Hmm... if I do a print() on the result of getFileName(), I get i8 * getelementptr ([9 x i8]* @.str, i32 0, i32 0) back, but if I try to dyn_cast this to GetElementPtrInst it fails (returning null), so presumably I'm seeing a GetElementPtrConstantExpr... so how can I get at that constant i8 array without casting to a GetElementPtrInst, and with GetElementPtrConstantExpr being inaccessible to user code? [s] On Apr 29, 2009, at 6:29 PM, Bill Wendling wrote:> On Wed, Apr 29, 2009 at 6:04 PM, Sarah Thompson <sarah at findatlantis.com > > wrote: >> Hi folks, >> >> I had some code that used to work fine in earlier versions of LLVM, >> but is now failing. I have some code that expands DbgStopPointInst >> failing to get the file name and path back, though it is still >> correctly getting line numbers. If you happen to have a code fragment >> that is known to work, it would be much appreciated. >> > Hi Sarah, > > I'm not sure if this will help you out, but take a look at how > DwarfWriter::getOrCreateSourceID is used. Unfortunately, I don't see > how to get the file name from a DbgStopPointInstr right offhand. > Things in the CodeGen/AsmPrinter/DwarfWriter.cpp file have changed > quite a bit in recent months... > > -bw > >> What it used to work was calling getFileName()->getNameStr() on the >> DbgStopPointInst, which returned a std::string, but in LLVM 2.5 the >> code compiles, but that string is empty. Any clues? >> >> [s] >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Seemingly Similar Threads
- [LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
- [LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
- [LLVMdev] DwarfDebug craziness
- [LLVMdev] line number information
- [LLVMdev] DwarfDebug craziness