[LLVMdev] Question about debugging dwarf generated by LLVM
Villmow, Micah
Micah.Villmow at amd.com
Tue May 31 18:00:13 PDT 2011
Say I have the following program and dwarf line number table.
Program:
kernel void nbt03( global uint *ip )
{
size_t groupSize = get_local_size(0);
for (int i=0; i < 256; ++i) {
*ip += groupSize;
}
}
Line Number Statements:
Extended opcode 2: set Address to 0x38
Special opcode 6: advance Address by 0 to 0x38 and Line by 1 to 2
Set column to 40
Extended opcode 2: set Address to 0x3e
Special opcode 6: advance Address by 0 to 0x3e and Line by 1 to 3
Set column to 16
Extended opcode 2: set Address to 0x4c
Special opcode 7: advance Address by 0 to 0x4c and Line by 2 to 5
Set column to 25
Extended opcode 2: set Address to 0x54
Special opcode 6: advance Address by 0 to 0x54 and Line by 1 to 6
Set column to 30
Extended opcode 2: set Address to 0x60
Special opcode 4: advance Address by 0 to 0x60 and Line by -1 to 5
Set column to 1
Extended opcode 2: set Address to 0x67
Special opcode 8: advance Address by 0 to 0x67 and Line by 3 to 8
Extended opcode 2: set Address to 0x8e
Advance PC by 0 to 8e
Extended opcode 1: End of Sequence
Address 0x60(italics) refers to the ++i in the for loop, if the beginning of the for loop jumps to a location,say 0x44, that is between 0x3e and 0x4c(bolded numbers), what line number should the debugger display on the screen?
There is really three options
1) Should the debugger use line 3 as it was the line number specified before the target address?
2) Should the debugger use line 5 as it is the line number specified after the target address?
3) The debugger should use the current line number because no line number commands exist for address 0x44?
As I am by no means an expert on debugging, I need advice from more experience developers. Also if it is possible to point me to any spec/documentation that might be useful to cite in the future for resolving this types of issues, it would be greatly appreciated.
Thanks,
Micah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110531/d362af15/attachment.html>
More information about the llvm-dev
mailing list