<div dir="ltr"><div class="gmail_extra"><span style="color:rgb(80,0,80)">On Tue, Jun 18, 2013 at 6:58 PM, <</span><a href="mailto:jingham@apple.com">jingham@apple.com</a><span style="color:rgb(80,0,80)">> wrote:</span><br>

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">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.)<br>

</div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>I think Jim is absolutely right here with his very useful reply. It looks like gdb ignores the prologue end stuff entirely (which makes sense since it doesn't look like gcc outputs it), and it sets the breakpoint on the second line table entry. But in this case:</div>

<div class="gmail_extra"><br></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

0x00400764  [   6, 0] NS uri: "/home/mikesart/data/src/blah2/blah.cpp"<br>0x00400796  [   6, 0] NS<br>0x004007bd  [  10, 0] NS<br>0x004007ea  [  11, 0] NS</blockquote><div class="gmail_extra"><br></div><div class="gmail_extra" style>

gdb is treating 0x004007bd as the second line table entry, and lldb is treating 0x00400796 as the second. This is pretty clear with the disassembly output down below.</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>

The problem in this case is that second block with the sse movaps instructions isn't run, so the breakpoint is never hit.</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>So I think the change would be in how lldb handles what the second line table entry is? Ie, skip duplicate entries.</div>

<div class="gmail_extra" style> -Mike</div><div class="gmail_extra"><br></div><div class="gmail_extra" style>(lldb) disassemble -n myprintf -m<br></div></div><div class="gmail_extra"><div class="gmail_extra">blah`myprintf(char const*, ...) at blah.cpp:6</div>

<div class="gmail_extra">   5    myprintf (const char *format, ...) </div><div class="gmail_extra">   6    {</div><div class="gmail_extra">   7      va_list arg; </div><div class="gmail_extra">blah[0x400764]:  pushq  %rbp</div>

<div class="gmail_extra">blah[0x400765]:  movq   %rsp, %rbp</div><div class="gmail_extra">blah[0x400768]:  subq   $224, %rsp</div><div class="gmail_extra">blah[0x40076f]:  movq   %rsi, -168(%rbp)</div><div class="gmail_extra">

blah[0x400776]:  movq   %rdx, -160(%rbp)</div><div class="gmail_extra">blah[0x40077d]:  movq   %rcx, -152(%rbp)</div><div class="gmail_extra">blah[0x400784]:  movq   %r8, -144(%rbp)</div><div class="gmail_extra">blah[0x40078b]:  movq   %r9, -136(%rbp)</div>

<div class="gmail_extra">blah[0x400792]:  testb  %al, %al</div><div class="gmail_extra">blah[0x400794]:  je     0x4007b6                  ; myprintf(char const*, ...) + 82 at blah.cpp:6</div><div class="gmail_extra">blah`myprintf(char const*, ...) + 50 at blah.cpp:6</div>

<div class="gmail_extra">   5    myprintf (const char *format, ...) </div><div class="gmail_extra">   6    {</div><div class="gmail_extra">   7      va_list arg; </div><div class="gmail_extra">blah[0x400796]:  movaps %xmm0, -128(%rbp)</div>

<div class="gmail_extra">blah[0x40079a]:  movaps %xmm1, -112(%rbp)</div><div class="gmail_extra">blah[0x40079e]:  movaps %xmm2, -96(%rbp)</div><div class="gmail_extra">blah[0x4007a2]:  movaps %xmm3, -80(%rbp)</div><div class="gmail_extra">

blah[0x4007a6]:  movaps %xmm4, -64(%rbp)</div><div class="gmail_extra">blah[0x4007aa]:  movaps %xmm5, -48(%rbp)</div><div class="gmail_extra">blah[0x4007ae]:  movaps %xmm6, -32(%rbp)</div><div class="gmail_extra">blah[0x4007b2]:  movaps %xmm7, -16(%rbp)</div>

<div class="gmail_extra">blah[0x4007b6]:  movq   %rdi, -216(%rbp)</div><div class="gmail_extra">blah`myprintf(char const*, ...) + 89 at blah.cpp:10</div><div class="gmail_extra">   9   </div><div class="gmail_extra">   10     va_start (arg, format);</div>

<div class="gmail_extra">   11     done = vfprintf (stdout, format, arg);</div><div class="gmail_extra">blah[0x4007bd]:  movl   $8, -208(%rbp)</div><div class="gmail_extra">blah[0x4007c7]:  movl   $48, -204(%rbp)</div><div class="gmail_extra">

blah[0x4007d1]:  leaq   16(%rbp), %rax</div><div class="gmail_extra">blah[0x4007d5]:  movq   %rax, -200(%rbp)</div><div class="gmail_extra">blah[0x4007dc]:  leaq   -176(%rbp), %rax</div><div class="gmail_extra">blah[0x4007e3]:  movq   %rax, -192(%rbp)</div>

<div class="gmail_extra">blah`myprintf(char const*, ...) + 134 at blah.cpp:11</div><div><br></div><div style><br></div><div style>(gdb) disassemble /m myprintf<br></div></div><div class="gmail_extra">Dump of assembler code for function myprintf(char const*, ...):</div>

<div class="gmail_extra">6       {</div><div class="gmail_extra">   0x0000000000400764 <+0>:     push   rbp</div><div class="gmail_extra">   0x0000000000400765 <+1>:     mov    rbp,rsp</div><div class="gmail_extra">

   0x0000000000400768:  sub    rsp,0xe0</div><div class="gmail_extra">   0x000000000040076f:  mov    QWORD PTR [rbp-0xa8],rsi</div><div class="gmail_extra">   0x0000000000400776:  mov    QWORD PTR [rbp-0xa0],rdx</div><div class="gmail_extra">

   0x000000000040077d:  mov    QWORD PTR [rbp-0x98],rcx</div><div class="gmail_extra">   0x0000000000400784:  mov    QWORD PTR [rbp-0x90],r8</div><div class="gmail_extra">   0x000000000040078b:  mov    QWORD PTR [rbp-0x88],r9</div>

<div class="gmail_extra">   0x0000000000400792:  test   al,al</div><div class="gmail_extra">   0x0000000000400794:  je     0x4007b6</div><div class="gmail_extra">   0x0000000000400796:  movaps XMMWORD PTR [rbp-0x80],xmm0</div>

<div class="gmail_extra">   0x000000000040079a:  movaps XMMWORD PTR [rbp-0x70],xmm1</div><div class="gmail_extra">   0x000000000040079e:  movaps XMMWORD PTR [rbp-0x60],xmm2</div><div class="gmail_extra">   0x00000000004007a2:  movaps XMMWORD PTR [rbp-0x50],xmm3</div>

<div class="gmail_extra">   0x00000000004007a6:  movaps XMMWORD PTR [rbp-0x40],xmm4</div><div class="gmail_extra">   0x00000000004007aa:  movaps XMMWORD PTR [rbp-0x30],xmm5</div><div class="gmail_extra">   0x00000000004007ae:  movaps XMMWORD PTR [rbp-0x20],xmm6</div>

<div class="gmail_extra">   0x00000000004007b2:  movaps XMMWORD PTR [rbp-0x10],xmm7</div><div class="gmail_extra">   0x00000000004007b6:  mov    QWORD PTR [rbp-0xd8],rdi</div><div class="gmail_extra">7         va_list arg;<br>

</div><div class="gmail_extra">8         int done;</div><div class="gmail_extra">9</div><div class="gmail_extra">10        va_start (arg, format);</div><div class="gmail_extra">   0x00000000004007bd:  mov    DWORD PTR [rbp-0xd0],0x8</div>

<div class="gmail_extra">   0x00000000004007c7:  mov    DWORD PTR [rbp-0xcc],0x30</div><div class="gmail_extra">   0x00000000004007d1:  lea    rax,[rbp+0x10]</div><div class="gmail_extra">   0x00000000004007d5:  mov    QWORD PTR [rbp-0xc8],rax</div>

<div class="gmail_extra">   0x00000000004007dc:  lea    rax,[rbp-0xb0]</div><div class="gmail_extra">   0x00000000004007e3:  mov    QWORD PTR [rbp-0xc0],rax</div><div class="gmail_extra">11        done = vfprintf (stdout, format, arg);<br>

</div><div class="gmail_extra">   0x00000000004007ea:  mov    rax,QWORD PTR [rip+0x20082f]        # 0x601020 <stdout@@GLIBC_2.2.5></div><div class="gmail_extra">   0x00000000004007f1:  lea    rdx,[rbp-0xd0]</div><div class="gmail_extra">

   0x00000000004007f8:  mov    rcx,QWORD PTR [rbp-0xd8]</div><div class="gmail_extra">   0x00000000004007ff:  mov    rsi,rcx</div><div class="gmail_extra">   0x0000000000400802:  mov    rdi,rax</div><div class="gmail_extra">

   0x0000000000400805:  call   0x400670 <vfprintf@plt></div><div class="gmail_extra">   0x000000000040080a:  mov    DWORD PTR [rbp-0xb4],eax</div><div class="gmail_extra">12        va_end (arg);<br></div><div class="gmail_extra">

13</div><div class="gmail_extra">14        return done;</div><div class="gmail_extra">   0x0000000000400810:  mov    eax,DWORD PTR [rbp-0xb4]</div><div class="gmail_extra">15      }<br></div><div class="gmail_extra">   0x0000000000400816:  leave</div>

<div class="gmail_extra">   0x0000000000400817:  ret</div><div><br></div></div></div>