<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Say I have the following program and dwarf line number table.<o:p></o:p></p><p class=MsoNormal>Program:<o:p></o:p></p><p class=MsoNormal>kernel void nbt03( global uint *ip )<o:p></o:p></p><p class=MsoNormal>{<o:p></o:p></p><p class=MsoNormal>    size_t groupSize = get_local_size(0);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    for (int i=0; i < 256; ++i) {<o:p></o:p></p><p class=MsoNormal>        *ip += groupSize;<o:p></o:p></p><p class=MsoNormal>    }<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal>Line Number Statements:<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x38<o:p></o:p></p><p class=MsoNormal>  Special opcode 6: advance Address by 0 to 0x38 and Line by 1 to 2<o:p></o:p></p><p class=MsoNormal>  Set column to 40<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x<b>3e</b><o:p></o:p></p><p class=MsoNormal>  Special opcode 6: advance Address by 0 to 0x3e and Line by 1 to 3<o:p></o:p></p><p class=MsoNormal>  Set column to 16<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x<b>4c</b><o:p></o:p></p><p class=MsoNormal>  Special opcode 7: advance Address by 0 to 0x4c and Line by 2 to 5<o:p></o:p></p><p class=MsoNormal>  Set column to 25<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x54<o:p></o:p></p><p class=MsoNormal>  Special opcode 6: advance Address by 0 to 0x54 and Line by 1 to 6<o:p></o:p></p><p class=MsoNormal>  Set column to 30<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x<i>60</i><o:p></o:p></p><p class=MsoNormal>  Special opcode 4: advance Address by 0 to 0x60 and Line by -1 to 5<o:p></o:p></p><p class=MsoNormal>  Set column to 1<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x67<o:p></o:p></p><p class=MsoNormal>  Special opcode 8: advance Address by 0 to 0x67 and Line by 3 to 8<o:p></o:p></p><p class=MsoNormal>  Extended opcode 2: set Address to 0x8e<o:p></o:p></p><p class=MsoNormal>  Advance PC by 0 to 8e<o:p></o:p></p><p class=MsoNormal>  Extended opcode 1: End of Sequence<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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?<o:p></o:p></p><p class=MsoNormal>There is really three options<o:p></o:p></p><p class=MsoNormal>1) Should the debugger use line 3 as it was the line number specified before the target address?<o:p></o:p></p><p class=MsoNormal>2) Should the debugger use line 5 as it is the line number specified after the target address?<o:p></o:p></p><p class=MsoNormal>3) The debugger should use the current line number because no line number commands exist for address 0x44?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Micah<o:p></o:p></p></div></body></html>