Vivien Millet via llvm-dev
2018-Mar-31 11:33 UTC
[llvm-dev] [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
Hi, First, considering I'm using an IRBuilder and a DIBuilder to build my program, how can I automatically bind the CreateAlloca with my named local variable inside the DIBuilder ? Is it automatic with the Twine name of CreateAlloca ? And/Or should I use DIBuilder::createAutoVariable and how ? Then, I'm wondering how to locate back my local variable in memory (register or stack) once i have a DwarfContext ready. I'm a bit lost with all this pipeline, sorry If my question seem trivial. Thanks ! Vivien -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180331/ae6d23a2/attachment.html>
via llvm-dev
2018-Apr-01 18:17 UTC
[llvm-dev] [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
Binding the alloca to the debug-info metadata is not automatic. You need to emit an intrinsic function call to llvm.dbg.declare to bind the two together. If you are simply trying to emit DWARF for your program, the rest of the processing should already be in place for that. If you are trying to do something else, you would need to describe that so we understand what you need. --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Vivien Millet via llvm-dev Sent: Saturday, March 31, 2018 7:33 AM To: llvm-dev Subject: [llvm-dev] [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext Hi, First, considering I'm using an IRBuilder and a DIBuilder to build my program, how can I automatically bind the CreateAlloca with my named local variable inside the DIBuilder ? Is it automatic with the Twine name of CreateAlloca ? And/Or should I use DIBuilder::createAutoVariable and how ? Then, I'm wondering how to locate back my local variable in memory (register or stack) once i have a DwarfContext ready. I'm a bit lost with all this pipeline, sorry If my question seem trivial. Thanks ! Vivien -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180401/48a8c514/attachment.html>
Vivien Millet via llvm-dev
2018-Apr-01 21:17 UTC
[llvm-dev] [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
Hi Paul, How can i make this call to intrinsic from the c++ code ? I'm not working with the IR language, but directly in C++ with IRBuilder::CreateAlloca. My goal is that one : - Generate machine code with an instance of the class 'IRBuilder' - Emit 'ObjFile' class instance with MCJIT - Create a DwarfContext instance directly from the emitted ObjFile object (DwarfContextInMemory) (on JitEventListener::NotifyObjectEmitted) - Use this DwarfContext to step into my home made runtime debugger. Now I can perform step over/into/out in my debugger using the DwarfContext instance without problem, but I'm still stuck on how to watch my local variables in my debugger (i can't figure out how to locate them in registers/stack from that DwarfContext) Thanks for your help 2018-04-01 20:17 GMT+02:00 <paul.robinson at sony.com>:> Binding the alloca to the debug-info metadata is not automatic. You need > to emit an intrinsic function call to llvm.dbg.declare to bind the two > together. > > If you are simply trying to emit DWARF for your program, the rest of the > processing should already be in place for that. If you are trying to do > something else, you would need to describe that so we understand what you > need. > > --paulr > > > > *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *Vivien > Millet via llvm-dev > *Sent:* Saturday, March 31, 2018 7:33 AM > *To:* llvm-dev > *Subject:* [llvm-dev] [Dwarf] Register a local variable in DIBuilder and > locate it later with a DwarfContext > > > > Hi, > > First, considering I'm using an IRBuilder and a DIBuilder to build my > program, how can I automatically bind the CreateAlloca with my named local > variable inside the DIBuilder ? Is it automatic with the Twine name of > CreateAlloca ? And/Or should I use DIBuilder::createAutoVariable and how ? > > > Then, I'm wondering how to locate back my local variable in memory > (register or stack) once i have a DwarfContext ready. > > I'm a bit lost with all this pipeline, sorry If my question seem trivial. > > Thanks ! > > Vivien >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180401/08e9f1b0/attachment.html>
Seemingly Similar Threads
- [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
- [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
- [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
- [DebugInfo][DIBuilder] Good way to pass arguments to createClassType/createMemberType
- [DIBuilder][DebugInfo] Parameter visible in "Locals" but not in "Watch" under msvc