<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.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;}
/* List Definitions */
@list l0
{mso-list-id:544025000;
mso-list-type:hybrid;
mso-list-template-ids:1421082900 -1221814354 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l1
{mso-list-id:1363164383;
mso-list-type:hybrid;
mso-list-template-ids:649737374 -24230952 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></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="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Wingdings"><span style="mso-list:Ignore">Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]>It's tough to tell what happens with lldb & gcc 4.8 because something else is broken there - I think lldb has trouble with dwarf4.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">FYI Mike, Daniel and I took care of most of the common DWARF4 issues this week. So, hopefully you can get a clearer picture on the way forward with the prologue.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Specifically, we are looking at tests that are okay with –gdwarf-2 but fail with -3 or -4. Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l1 level1 lfo2"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ashok<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> lldb-dev-bounces@cs.uiuc.edu [mailto:lldb-dev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Michael Sartain<br>
<b>Sent:</b> Wednesday, June 19, 2013 1:49 PM<br>
<b>To:</b> jingham@apple.com<br>
<b>Cc:</b> lldb-dev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [lldb-dev] breakpoint command<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jun 18, 2013 at 6:58 PM, <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<o:p></o:p></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">> If we have no prologue_end marker, would it make sense to not skip anything?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">I don't know what more recent gcc's do, but they used to omit the prologue_end marker, and instead use the convention that the first line table entry for the function is the beginning of the function, and the second is the end of the prologue.
gdb has relied on that for a long long time (in absence of the prologue_end and back to the stabs days when there was no such thing.) So not skipping the prologue in this case seems like throwing the baby out with the bath water. Better would be to get
your compiler to get it right...<o:p></o:p></p>
</blockquote>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On Wed, Jun 19, 2013 at 10:34 AM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">I agree with Jim here and I would vote to still try and skip something. The strongest reason I have for this recommendation is that the debug info for args and locals _relies_ on being past the prologue, and doesn't describe the location
correctly for the arguments and locals in the prologue. So when users set a breakpoint on "printf" and they stop there, all variable information is usually bogus until the prologue has been executed. Users don't like seeing garbage values (they file bugs)
and then stepping over the first line and then saying "now the variables are correct".<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
I agree it'd be nice for the compiler to get it right, but we have folks that are going to try to use this debugger, they're going to try to set a breakpoint, and when it sets that breakpoint in the middle of the function they will just switch back to gdb -
they rightfully won't care about prologue end markers or compiler bugs.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I'm all for figuring out how to skip something when we don't have that info, but I'd prefer to error on the side of caution. Having some locals with garbage in them seems better to me than having your breakpoint not hit at all or hit after
something important you wanted to debug.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For whatever it's worth, this is broken with gcc 4.6, and it appears to be broken in gcc 4.8. It's tough to tell what happens with lldb & gcc 4.8 because something else is broken there - I think lldb has trouble with dwarf4.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">This is the debug_line info gcc 4.8 produces (identical to gcc 4.6) for the little program down below.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">.debug_line: line number info for a single cu<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Source lines (from CU-DIE at .debug_info offset 0x0000000b):<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> NS new statement, BB new basic block, ET end of text sequence<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> PE prologue end, EB epilogue begin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> IA=val ISA number, DI=val discriminator value<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><pc> [row,col] NS BB ET PE EB IS= DI= uri: "filepath"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x00400900 [ 6, 0] NS uri: "/home/mikesart/data/src/blah2/blah.cpp"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x00400932 [ 6, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x00400959 [ 10, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x00400986 [ 11, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009ac [ 14, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009bc [ 15, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009be [ 18, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009cd [ 19, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009e1 [ 20, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009e6 [ 21, 0] NS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">0x004009e8 [ 21, 0] NS ET<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> 1 #include <stdio.h><o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> 2 #include <stdarg.h><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 3 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 4 int<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 5 myprintf (const char *format, ...)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 6 {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 7 va_list arg;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 8 int done;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 9 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 10 va_start (arg, format);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 11 done = vfprintf (stdout, format, arg);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 12 va_end (arg);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 13 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 14 return done;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 15 }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 16 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 17 int main( int argc, char *argv[] )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 18 {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 19 myprintf("blah is %d\n", 5);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 20 return 0;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> 21 }<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>