<div dir="ltr"><div class="gmail_extra">On Wed, Jun 19, 2013 at 2:49 PM, Michael Sartain <span dir="ltr"><<a href="mailto:mikesart@valvesoftware.com" target="_blank">mikesart@valvesoftware.com</a>></span> wrote:<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">So I think the change would be in how lldb handles what the second line table entry is? Ie, skip duplicate entries.</blockquote>

</div><br>I've added to this patch:<br><br><a href="http://llvm-reviews.chandlerc.com/D960">http://llvm-reviews.chandlerc.com/D960</a><br><br>Modified Symbol::GetPrologueByteSize() in source/Symbol/Symbol.cpp and 
Function::GetPrologueByteSize() in source/Symbol/Function.cpp. They should both now skip line entries until they find a line number that differs.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>

One question: would it make sense to have Symbol::GetPrologueByteSize() check to see if it is an exact alias to a function and if so, use the Function::GetPrologueByteSize() routine? That way we'd get the prologue end data instead of just skipping lines?</div>

<div class="gmail_extra"><br></div><div class="gmail_extra" style>In any case, breakpoint setting in the printf case works as it should now:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">

(lldb) b printf</div><div class="gmail_extra">Breakpoint 2: where = libc.so.6`__printf + 91 at printf.c:34, address = 0x00007f8dba8b189b</div><div class="gmail_extra">(lldb) b __printf</div><div class="gmail_extra">Breakpoint 3: where = libc.so.6`__printf + 91 at printf.c:34, address = 0x00007f8dba8b189b</div>

<div class="gmail_extra">(lldb) b _IO_printf</div><div class="gmail_extra">Breakpoint 4: where = libc.so.6`__printf + 91 at printf.c:34, address = 0x00007f8dba8b189b</div><div class="gmail_extra">(lldb) disassemble -n printf</div>

<div class="gmail_extra">libc.so.6`__printf at printf.c:30:</div><div class="gmail_extra">   0x7f8dba8b1840:  subq   $216, %rsp</div><div class="gmail_extra"><br></div><div class="gmail_extra">libc.so.6`__printf + 7 at printf.c:30:</div>

<div class="gmail_extra">   0x7f8dba8b1847:  testb  %al, %al</div><div class="gmail_extra">   0x7f8dba8b1849:  movq   %rsi, 40(%rsp)</div><div class="gmail_extra">   0x7f8dba8b184e:  movq   %rdx, 48(%rsp)</div><div class="gmail_extra">

   0x7f8dba8b1853:  movq   %rcx, 56(%rsp)</div><div class="gmail_extra">   0x7f8dba8b1858:  movq   %r8, 64(%rsp)</div><div class="gmail_extra">   0x7f8dba8b185d:  movq   %r9, 72(%rsp)</div><div class="gmail_extra">   0x7f8dba8b1862:  je     0x7f8dba8b189b            ; __printf + 91 at printf.c:34</div>

<div class="gmail_extra">   0x7f8dba8b1864:  movaps %xmm0, 80(%rsp)</div><div class="gmail_extra">   0x7f8dba8b1869:  movaps %xmm1, 96(%rsp)</div><div class="gmail_extra">   0x7f8dba8b186e:  movaps %xmm2, 112(%rsp)</div>
<div class="gmail_extra">
   0x7f8dba8b1873:  movaps %xmm3, 128(%rsp)</div><div class="gmail_extra">   0x7f8dba8b187b:  movaps %xmm4, 144(%rsp)</div><div class="gmail_extra">   0x7f8dba8b1883:  movaps %xmm5, 160(%rsp)</div><div class="gmail_extra">

   0x7f8dba8b188b:  movaps %xmm6, 176(%rsp)</div><div class="gmail_extra">   0x7f8dba8b1893:  movaps %xmm7, 192(%rsp)</div><div class="gmail_extra">   0x7f8dba8b189b:  leaq   224(%rsp), %rax</div><div class="gmail_extra">

   0x7f8dba8b18a3:  movq   %rdi, %rsi</div><div class="gmail_extra">   0x7f8dba8b18a6:  leaq   8(%rsp), %rdx</div><div class="gmail_extra">   0x7f8dba8b18ab:  movl   $8, 8(%rsp)</div><div class="gmail_extra">   0x7f8dba8b18b3:  movl   $48, 12(%rsp)</div>

<div class="gmail_extra">   0x7f8dba8b18bb:  movq   %rax, 16(%rsp)</div><div class="gmail_extra">   0x7f8dba8b18c0:  leaq   32(%rsp), %rax</div><div class="gmail_extra">   0x7f8dba8b18c5:  movq   %rax, 24(%rsp)</div><div class="gmail_extra">

   0x7f8dba8b18ca:  movq   3556935(%rip), %rax</div><div class="gmail_extra">   0x7f8dba8b18d1:  movq   (%rax), %rdi</div><div class="gmail_extra">   0x7f8dba8b18d4:  callq  0x7f8dba8a69c0            ; _IO_vfprintf_internal at vfprintf.c:211</div>

<div class="gmail_extra">   0x7f8dba8b18d9:  addq   $216, %rsp</div><div class="gmail_extra">   0x7f8dba8b18e0:  ret    </div><div><br></div></div><div class="gmail_extra">I'd love to hear feedback on this patch and the split symbol patch overall. I've built it on the Mac using cmake & ninja (won't run locally without debugserver though?). I'm still having issues with xcodebuild randomly failing to link on my Mac, and it seems to rebuild the whole thing when I launch xcodebuild again which takes forever. (This Mac thing has been pretty frustrating.) I've run the entire test suite on Linux, and it says there are some new failure cases but when I run them individually (not through ninja check-lldb) they work. So I'm finding it a bit difficult to verify all this stuff. I'm also gone all next week, so if folks are worried about this large patch it might make sense to wait until early July. I would like to get it looked over and in at some point because the merging is becoming more painful.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Thanks.</div><div class="gmail_extra" style> -Mike</div></div>