Matt Pharr
2011-Aug-01 05:49 UTC
[LLVMdev] Debugging information problem: code being reordered / debug point jumping around
I'm seeing some undesirable behavior where, when generating debugging information, sometimes the point in the debugger will jump forwards and backwards during single stepping, even though the output from our frontend (this is the ispc compiler), is emitting LLVM instructions with a strictly forward-moving/increasing set of source locations. I'm wondering if we're doing something wrong here, or if this points to a bug somewhere in LLVM. I've attached a case that demonstrates this. Specifically, the instructions in the LLVM assembly language for the foo() function have the following metadata items associated with them, in the following order: 5519, 5520, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5521. These correspond to the source file locations: [4,22], [5,5], [5,11], [5,22], [5,23], [6,14], [6,22], [6,24], [6,26], [8,11], [8,15], [9,9], [9,10], [9,11], [10,12], [10,12]. ([line, column]). However, if I run "llc -O0 debug.ll -o debug.s" with top of tree, the set of source locations indicated in comments jumps from [5,23] to [9,10], and then back to [6,22]. (And if I single-step through this code in gdb, I see the corresponding jump around.) I'd be happy to hear any comments or suggestions! Thanks, -matt -------------- next part -------------- A non-text attachment was scrubbed... Name: debug.ll.gz Type: application/x-gzip Size: 66731 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110801/12b17772/attachment.bin>
Devang Patel
2011-Aug-01 14:27 UTC
[LLVMdev] Debugging information problem: code being reordered / debug point jumping around
On Jul 31, 2011, at 10:49 PM, Matt Pharr wrote:> I'm seeing some undesirable behavior where, when generating debugging information, sometimes the point in the debugger will jump forwards and backwards during single stepping, even though the output from our frontend (this is the ispc compiler), is emitting LLVM instructions with a strictly forward-moving/increasing set of source locations. I'm wondering if we're doing something wrong here, or if this points to a bug somewhere in LLVM. > > I've attached a case that demonstrates this. Specifically, the instructions in the LLVM assembly language for the foo() function have the following metadata items associated with them, in the following order: 5519, 5520, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5521. These correspond to the source file locations: [4,22], [5,5], [5,11], [5,22], [5,23], [6,14], [6,22], [6,24], [6,26], [8,11], [8,15], [9,9], [9,10], [9,11], [10,12], [10,12]. ([line, column]). > > However, if I run "llc -O0 debug.ll -o debug.s" with top of tree, the set of source locations indicated in comments jumps from [5,23] to [9,10], and then back to [6,22]. (And if I single-step through this code in gdb, I see the corresponding jump around.) > > I'd be happy to hear any comments or suggestions!What do you see after instruction select ? I'll take a look at this. Meanwhile, please file bugzilla report so that this does not get lost. - Devang
Matt Pharr
2011-Aug-01 15:35 UTC
[LLVMdev] Debugging information problem: code being reordered / debug point jumping around
On Aug 1, 2011, at 3:27 PM, Devang Patel wrote:> What do you see after instruction select ?Good question--I just checked. Things are still in the right order going into the x86 DAG->DAG instruction select pass, but then are out of order coming out of it. So that looks like the culprit...> I'll take a look at this. Meanwhile, please file bugzilla report so that this does not get lost.Thanks. http://llvm.org/bugs/show_bug.cgi?id=10550 -matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110801/08821449/attachment.html>
Reasonably Related Threads
- [LLVMdev] Debugging information problem: code being reordered / debug point jumping around
- [LLVMdev] Debugging information problem: code being reordered / debug point jumping around
- [LLVMdev] Bug with debug information generation?
- [LLVMdev] How to strip all unused debugging metadata?
- [LLVMdev] How to strip all unused debugging metadata?