<div dir="ltr">This change went up here, with a couple tweaks to documentation (per Greg and another minor grammatical fix):<div><br></div><div><div>svn commit</div><div>Sending source/Target/Target.cpp</div><div>Transmitting file data .</div><div>Committed revision 218405.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 11:08 AM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Doug - I'll get this in.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 11:04 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just replace "eInlineBreakpointsHeaders" with "headers" and you are good to go.<br>
<div><div><br>
> On Sep 24, 2014, at 11:01 AM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
><br>
> i'll fix that and create a new patch<br>
><br>
><br>
><br>
> On Wed, Sep 24, 2014 at 10:57 AM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> The text is wrong in the help text. It should't mention "eInlineBreakpointsHeaders", but it should mention "headers" (the actual text you would type for the settings set command). Other than that, it looks good.<br>
><br>
> > On Sep 23, 2014, at 3:22 PM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
> ><br>
> > I think the patch might be missing from that mail. Here it is though:<br>
> ><br>
> ><br>
> ><br>
> > On Tue, Sep 23, 2014 at 3:20 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
> > here is a patch that sets the default to eInlineBreakpointsAlways. it also changes the associated comment text, since the old text was eInlineBreakpointsHeaders-default-centric<br>
> ><br>
> > i manually tested it with lldb using one of my test cases and ran check-lldb on ubuntu to make sure it wasn't breaking other things<br>
> ><br>
> ><br>
> > On Tue, Sep 23, 2014 at 12:52 PM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> > I would vote to switch over to using "always" as the default setting and then let people who run into performance problems set it to "headers"<br>
> ><br>
> > I am not fond of the two state approach because you might be trying to set a breakpoint a shared library that isn't loaded yet.<br>
> ><br>
> > More comments below:<br>
> ><br>
> > > On Sep 23, 2014, at 12:21 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
> > ><br>
> > > it appears that there are a number of possible options for addressing lldb's inability to set breakpoints when using ccache, with preprocess files and with include files<br>
> > > 1) continue using "settings set target.inline-breakpoint-strategy always" to get around the problem. however, many/most users aren't aware of this setting and aren't aware that they can get around the problem. also, the name doesn't imply that this setting will fix the problem for ccache or for preprocessed files<br>
> ><br>
> > We should just make it the default. I don't like that we miss breakpoints for no good reason and rely upon an obscure setting to fix this.<br>
> ><br>
> > > 2) improve the search speed so it's feasible to search all include files when working with large projects. this could eliminate the need for "settings set target.inline-breakpoint-strategy always". i don't know how involved this effort would be.<br>
> ><br>
> > Search speed isn't the problem, it is the number of files that get touched on disk. There probably won't be any performance issues on other systems until fission becomes real, but at Apple we leave the debug info in the .o files and when debugging large projects we end up having to open thousands of .o files. Is is the file cache getting warmed up that causes the performance problems.<br>
> ><br>
> > > 3) add a two-stage file search if the "set breakpoint" initially finds 0 locations. i have included a possible patch for this with a description below<br>
> ><br>
> > I don't like this because if you have a shared library that isn't loaded yet, you will get no matches, then try again with inlines. It also doesn't help catch actual inlined locations in the case where you might have an inlined function and an actual concrete instance when the inlining depth gets exceeded.<br>
> ><br>
> > > 4) add .c/.cpp/.m include files to the list of files to search. (don't add .h files). this would fix the problem with ccache and preprocessed files. this would also make unit builds work. "settings set target.inline-breakpoint-strategy always" would still be needed for inline routines in .h files. i don't know how well this fits in with the current system of searching modules and compile_units.<br>
> > > 5) allow different platforms to select how they wish to handle this. the best strategy for xcode may be different than the best strategy for android.<br>
> > > 6) some combination of options above<br>
> ><br>
> ><br>
> > I just suggest changing the default to "always" and we can have people that have performance problems change their setting to get the performance back.<br>
> ><br>
> > Greg<br>
> ><br>
> > ><br>
> > ><br>
> > ><br>
> > > two-stage file search<br>
> > > -------------------------------<br>
> > > attached is a patch (target.cpp.diff) that will add include files to the search list if a "set breakpoint" has initially found 0 locations and check_inlines was false. the second search basically mimics using "settings set target.inline-breakpoint-strategy always".<br>
> > ><br>
> > > this seems to enable setting breakpoints with ccache, preprocessed files and include files without having to set "target.inline-breakpoint-strategy always"<br>
> > ><br>
> > > known issues with this patch:<br>
> > > 1) in very large projects, if the "set breakpoint" has 0 locations in the non-include files, it may take a long time to find (or not find) the breakpoint in the include files<br>
> > > 2) there is a somewhat clunky breakpoint ID system in the breakpoint list. i was able to eliminate a non-sequential ID on a search retry, but the next "set breakpoint" will have a non-sequential ID. there probably is a way to fix this, but i didn't see it.<br>
> > ><br>
> > ><br>
> > ><br>
> > > breakpoint unit tests<br>
> > > ----------------------------<br>
> > > attached are two new unit tests (include.zip and preprocess.zip) i created to test whether breakpoints can be set in include files and preprocessed files<br>
> > ><br>
> > > i used these unit tests to verify that the two-stage file search patch allows setting breakpoints without "settings set target.inline-breakpoint-strategy always"<br>
> > ><br>
> > > i normally place these folders in lldb/test/functionalities/breakpoint<br>
> > ><br>
> > ><br>
> > ><br>
> > > doug<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > On Thu, Sep 18, 2014 at 3:52 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
> > > what if the logic was changed to do what it does now, but if the "set breakpoint" returns 0 locations, then try again with target.inline-breakpoint-strategy set?<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > On Thu, Sep 18, 2014 at 3:41 PM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> > > Because it vastly improves performance for large Objective C and C++ projects when setting file and line breakpoints. See our troubleshooting page for more details:<br>
> > ><br>
> > > <a href="http://lldb.llvm.org/troubleshooting.html" target="_blank">http://lldb.llvm.org/troubleshooting.html</a><br>
> > ><br>
> > ><br>
> > > > On Sep 18, 2014, at 3:38 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
> > > ><br>
> > > > adding that setting to .lldbinit appears to fix all three cases (ccache, preprocess and include). this was tested in xcode with individual test cases that i created.<br>
> > > ><br>
> > > > i wonder why that setting is not on by default?<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > On Thu, Sep 18, 2014 at 1:42 PM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
> > > > Hey Doug,<br>
> > > ><br>
> > > > Can you give Jim's suggestin a try and see if that affects anything?<br>
> > > ><br>
> > > > Thanks,<br>
> > > > Todd<br>
> > > ><br>
> > > > On Wed, Sep 17, 2014 at 2:39 PM, <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br>
> > > > Are any of these bugs fixed by setting:<br>
> > > ><br>
> > > > settings set target.inline-breakpoint-strategy always<br>
> > > ><br>
> > > > in your .lldbinit file?<br>
> > > ><br>
> > > > Jim<br>
> > > ><br>
> > > > > On Sep 17, 2014, at 10:34 AM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br>
> > > > ><br>
> > > > > i have been investigating several lldb bugs that seem to be related.<br>
> > > > ><br>
> > > > > bug 19974 describes lldb's inability to set a breakpoint in an included file and bug 20297 describes lldb's inability to set a breakpoint when using ccache. i have also found a similar case where lldb is unable to set a breakpoint when a separate preprocess step has been used before compiling.<br>
> > > > ><br>
> > > > > note: ccache uses a preprocess step to determine which source files need to be rebuilt so using ccache could be considered the same as using a separate preprocess step.<br>
> > > > ><br>
> > > > > all three cases are similar in that the c/c++ preprocessor is involved and alters the way symbols are added to the object files.<br>
> > > > ><br>
> > > > > the following attached files are write-ups of some of my findings for the different cases<br>
> > > > > ccache - "lldb and ccache.rtf"<br>
> > > > > preprocessed files - "lldb and preprocessed files.rtf"<br>
> > > > > include files - "lldb and include files.rtf"<br>
> > > > ><br>
> > > > > all three cases generate the inability to set breakpoints<br>
> > > > ><br>
> > > > > on the Mac, all three cases create object files with "SOL" symbols for preprocessed or included source files.<br>
> > > > ><br>
> > > > > the following attached file describes the object files created for the preprocessed test case on the Mac:<br>
> > > > > "preprocessed object files.rtf"<br>
> > > > ><br>
> > > > > on ubuntu, it is not as obvious to spot differences in the object files when examining object files that that lldb is unable to set breakpoints.<br>
> > > > ><br>
> > > > > lldb is unable to set breakpoints on both OSX and ubuntu for all three cases. gdb is able to set breakpoints on both OSX and ubuntu for all three cases.<br>
> > > > ><br>
> > > > > using XCode, i have tried a couple different ways of stepping through lldb to see why it is having trouble setting breakpoints.<br>
> > > > ><br>
> > > > > From top-down, i have traced setting breakpoints in Breakpoint.cpp down thru BreakpointResolver.cpp. The intended source file does not seem to be in the list of compute units, but i don't know why.<br>
> > > > ><br>
> > > > > From bottom-up, i have tried to follow how ObjectFileMachO.cpp parses symbols, but i'm not sure that this is the correct place to look. Also, since this is both a MachO problem and an Elf problem, the problem isn't likely to be here anyway.<br>
> > > > ><br>
> > > > > Does anyone familiar with lldb's architecture have any ideas where in the code i should be looking or have a plan-of-attack to suggest?<br>
> > > > ><br>
> > > > > thanks,<br>
> > > > > doug<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > <lldb and ccache.rtf><lldb and preprocessed files.rtf><preprocessed object files.rtf><lldb and include files.rtf>_______________________________________________<br>
> > > > > lldb-dev mailing list<br>
> > > > > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > lldb-dev mailing list<br>
> > > > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > --<br>
> > > > Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > lldb-dev mailing list<br>
> > > > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> > ><br>
> > ><br>
> > ><br>
> > > <target.cpp.diff><include.zip><preprocess.zip><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
> ><br>
> > <InlineBreakpointsAlways.patch><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>