search for: setdebuglocation

Displaying 20 results from an estimated 29 matches for "setdebuglocation".

2018 Aug 07
3
[RFC] Add DebugLoc parameter in Instruction’s Create() functions
Many DI-related bugs are caused by missing Debug Location in an instruction created in a transformation. Most of the time the fix is trivial once you found where the culprit instruction is created (https://reviews.llvm.org/D50263). Currently, when you create a new Instruction, in order to give it DL you have to either use an IRBuilder that is previously set to the correct DL or “manually” create
2010 Sep 02
3
[LLVMdev] Line number information (and other metadata)
I'd like my compiler to emit proper line number information. The docs talk about Instruction::setDebugLoc(), but that method doesn't actually have to be in my 2.7 LLVM Debian package. What's the correct way of doing this? In addition, can anyone point me at an example of how to emit a comment attached to an instruction (or function)? -- ┌─── dg@cowlark.com ─────
2010 Sep 02
0
[LLVMdev] Line number information (and other metadata)
On 02/09/10 11:27, David Given wrote: > I'd like my compiler to emit proper line number information. The docs > talk about Instruction::setDebugLoc(), but that method doesn't actually > have to be in my 2.7 LLVM Debian package. What's the correct way of > doing this? Grr stupid typo. > The docs > talk about Instruction::setDebugLoc(), but that method doesn't
2015 May 13
2
[LLVMdev] Modifying debug information through llvm pass
Hi All, I want to change debug information of an llvm instruction so that the modified debug info is subsequently passed to executable binary. So if I use "addr2line" utility on the binary, it will return my modified debug information. I've tried to change by using the following code snippet: MDNode *N = Inst->getMetadata("dbg"); DebugLoc Loc =
2011 Mar 25
2
[LLVMdev] set line number debug info
Thanks for the help. I thought I'd solved the problem (setting the line number information in the instruction metadata) by inserting my own function for setting line number in llvm/Support/DebugLoc.h. I have added a function setLine(unsigned) in DebugLoc class. The function simply sets the LineCol variable as needed. But there is a problem. Whenever I'm checking the line number(calling
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
Hi, I'm trying to replace function call with call to wrapper(function_name, num_args, ...), where varargs hold args of original call. Function* launch = Function::Create( TypeBuilder<int(const char*, int, ...), false>::get(context), GlobalValue::ExternalLinkage, "kernelgen_launch_", m2); { CallInst* call = dyn_cast<CallInst>(cast<Value>(I)); if
2020 Feb 27
3
How to set DebugLoc when using IRBuilder's CreateCall ?
Hi I want to insert some functions into the llvm bitcode ir files. So I use IRBuilder and CreateCall(). But it how error : inlinable function call in a function with debug info must have a !dbg location. I don't know what DebugLoc should I give the new CallInst to setDebugLoc. I Create this CallInst , so this CallInst doesn't hava so-called "DebugLoc" mapping to the source
2010 Sep 02
2
[LLVMdev] Line number information (and other metadata)
On 2 September 2010 11:35, David Given <dg at cowlark.com> wrote: >> The docs >> talk about Instruction::setDebugLoc(), but that method doesn't >> actually appear to be in my 2.7 LLVM Debian package. I suggest you getting the SVN code, since quite a lot has changed since last freeze. -- cheers, --renato http://systemcall.org/ Reclaim your digital rights, eliminate
2014 Jan 25
2
[LLVMdev] clang doesn't set code column in debug info records
This is maybe a minor issue, but it is obvious when one looks at debug info produced by clang. Such records are normally created by the code like this: Instruction->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); and it appears that Column is always zero. Yuri
2019 Jan 14
2
Metadata/DebugInfo in *.ll file
Generally, a good strategy is to look at what Clang generates for similar code and mimic that in your IR generator. -- adrian
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. >
2011 Mar 25
0
[LLVMdev] set line number debug info
Oh! I made a mistake by not using setDebugInfo() function present in the Instruction class. Now it's working fully. So, the solution is:- To set the line number for an instruction - 1. Add a function in DebugLoc class located in llvm/Support/DebugLoc.h. Set the line number there to the private variable called LineCol. 2. Call the added function. And then pass the modified DebugLoc object to
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
2011 Sep 22
0
[LLVMdev] How to const char* Value for function argument
Hi Dimitry, This makes sense if you think about it from the perspective that the string you want passing must be passed at runtime, and so can't use a const char * from compile time. You need to make the string visible in the compiled image, and use that as the argument. A string is an array of 8-bit integers, so you need to create a ConstantArray. Value *v = ConstantArray::get(Context,
2010 Aug 28
2
[LLVMdev] "Cannot fine DIE"
...then why ? Otherwise, the DIE was dropped somewhere after > compiler generated code. > > I've discovered a little bit more, but not enough to solve the problem. Here's what my code looks like for setting the debug location (some details removed for clarity): void CodeGenerator::setDebugLocation(const SourceLocation & loc) { if (loc != dbgLocation_ && dbgContext_.isScope()) { dbgLocation_ = loc; if (loc.file == NULL) { builder_.SetCurrentDebugLocation(llvm::DebugLoc()); } else if (loc.file == module_->moduleSource()) { TokenPosition pos = tokenPosit...
2010 Sep 07
1
[LLVMdev] help converting llvm metadata into dwarf tags
hi Devang and thanks for the tips, i finally managed to fit all the pieces together into something that seems to work. It's probably not the best (or even correct!) way of doing it but here's a brief overview for reference: An instruction in the LLVM IR gets converted into an SDNode in the DAG then later into a MachineInstr. I'd already attached my own MDNodes to IR instructions I
2010 Aug 29
0
[LLVMdev] "Cannot fine DIE"
...dropped somewhere after >> compiler generated code. >> >> I've discovered a little bit more, but not enough to solve the problem. > > Here's what my code looks like for setting the debug location (some details > removed for clarity): > > void CodeGenerator::setDebugLocation(const SourceLocation & loc) { > if (loc != dbgLocation_ && dbgContext_.isScope()) { > dbgLocation_ = loc; > if (loc.file == NULL) { > builder_.SetCurrentDebugLocation(llvm::DebugLoc()); > } else if (loc.file == module_->moduleSource()) { >...
2010 Sep 02
0
[LLVMdev] Line number information (and other metadata)
On Sep 2, 2010, at 4:05 AM, Renato Golin wrote: > On 2 September 2010 11:35, David Given <dg at cowlark.com> wrote: >>> The docs >>> talk about Instruction::setDebugLoc(), but that method doesn't >>> actually appear to be in my 2.7 LLVM Debian package. > > I suggest you getting the SVN code, since quite a lot has changed > since last freeze.
2012 Aug 01
1
[LLVMdev] How to insert metadata in llvm IR?
As title. I try to write a pass to covert the bitcode with no debug info to the bitcode with debug info. I use DIBuilder as a LLVM API so that I can generate DI(Debug info). Now I have some DIDescriptor , e.g. DIVariable ,DICompileUnit, DISubprogram , I can use some function to insert metadata. 1. LLVM::Instruction::SetDebugLoc(...) => insert the debug info location like DILexicalBlock
2019 Jan 14
2
Metadata/DebugInfo in *.ll file
Hi list, I found relevant documentation regarding DebugInfo creation in the LLVM IR bytecode. It can be done for compileunits, functions, and other constructs, with the help of DIBuilder class. However I can't save debug information related to individual llvm::Instructions. I tried DebugLoc, DILocation setting directly with setMetadata(). I tried other ways, for e.g.: