I need to generate line number debug information for PIC16 target. PIC16 does not support dwarf format. It supports coff format. So I need to custom handle the STOPPOINT nodes. Without -fast option the STOPPOINT nodes are not created in dag because of the below check in SelectionDAGBuild.cpp if (Fast) DAG.setRoot(DAG.getDbgStopPoint(getRoot(), If I give -fast option then the Fast flag is true, but the dag doesn't contain STOPPOINT nodes. If I have simple loads and stores in source code, the dag doesn't contain them too. Why are these nodes not being created? Thanks Vasudev
On Apr 5, 2009, at 11:54 PMPDT, vasudev wrote:> I need to generate line number debug information for PIC16 target. > PIC16 does not support dwarf format. It supports coff format. So I > need > to custom handle the STOPPOINT nodes. Without -fast option the > STOPPOINT > nodes are not created in dag because of the below check in > SelectionDAGBuild.cpp > if (Fast) > DAG.setRoot(DAG.getDbgStopPoint(getRoot(), > If I give -fast option then the Fast flag is true, but the dag doesn't > contain STOPPOINT nodes.Right. Currently, the way we tell whether optimization was requested at the command line level is to look at -fast; -O0 == -fast. The stoppoint nodes enforce an ordering of loads and stores corresponding to the original source, which means that putting them in without -fast would lead to codegen (scheduling) differences between - O and -O -g. We don't want that. Instead, the debug info is transferred at this point from stoppoint nodes to the DebugLoc field in each MachineInstr node. You should probably use that. (The current state of debug info with -O is that we think -g never affects codegen; violations of that should be reported as bugs. The quality of the debug info has not been worked on much and is problematic.)> If I have simple loads and stores in source > code, the dag doesn't contain them too. Why are these nodes not being > created?I don't know. Something to do with your target, they appear for me.
Thanks for the info regarding DebugLoc field. Another related question that I have is regarding debug info for local variables. With -fast option, ISD::DECLARE nodes are created in DAG for debug info of local variables. I am planning to custom handle these nodes, get the required info from llvm.dbg.variable global address and emit it in ISel. But without -fast option ISD::DECLARE nodes are not created. How can i access the debug info for local variables in that case? Is it available directly somewhere in AsmPrinter like the debug info for global variables? Dale Johannesen wrote:> On Apr 5, 2009, at 11:54 PMPDT, vasudev wrote: > > >> I need to generate line number debug information for PIC16 target. >> PIC16 does not support dwarf format. It supports coff format. So I >> need >> to custom handle the STOPPOINT nodes. Without -fast option the >> STOPPOINT >> nodes are not created in dag because of the below check in >> SelectionDAGBuild.cpp >> if (Fast) >> DAG.setRoot(DAG.getDbgStopPoint(getRoot(), >> If I give -fast option then the Fast flag is true, but the dag doesn't >> contain STOPPOINT nodes. >> > > Right. Currently, the way we tell whether optimization was requested > at the command line level is to look at -fast; -O0 == -fast. > The stoppoint nodes enforce an ordering of loads and stores > corresponding to the original source, which means that putting them in > without -fast would lead to codegen (scheduling) differences between - > O and -O -g. We don't want that. > > Instead, the debug info is transferred at this point from stoppoint > nodes to the DebugLoc field in each MachineInstr node. You should > probably use that. > > (The current state of debug info with -O is that we think -g never > affects codegen; violations of that should be reported as bugs. The > quality of the debug info has not been worked on much and is > problematic.) > > >> If I have simple loads and stores in source >> code, the dag doesn't contain them too. Why are these nodes not being >> created? >> > > > I don't know. Something to do with your target, they appear for me. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Apparently Analagous Threads
- [LLVMdev] debug stoppoint nodes with -fast option
- [LLVMdev] debug stoppoint nodes with -fast option
- [LLVMdev] debug stoppoint nodes with -fast option
- [LLVMdev] debug stoppoint nodes with -fast option
- [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0