<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Are glob characters legal file characters on any systems? If so we can't do the auto detect where we override the meaning of -f. If not, then we can. We could add a --glob option that goes along with the -f option if glob characters are valid file system characters.<div class=""><br class=""></div><div class="">There are a few breakpoint options that aren't available via the lldb::SB API layer. Not skipping the prologue for breakpoints by name and regex is one of them.</div><div class=""><br class=""></div><div class="">It would be nice to follow other examples where we make a options class that has nice defaults and get sent to each breakpoint kind.</div><div class=""><br class=""></div><div class="">The current API is:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">lldb</span><span style="font-variant-ligatures: no-common-ligatures" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">SBBreakpoint</span><span style="font-variant-ligatures: no-common-ligatures" class=""> BreakpointCreateByName(</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">char</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *symbol_name,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                                            </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">char</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *module_name = </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">nullptr</span><span style="font-variant-ligatures: no-common-ligatures" class="">);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span><span style="font-variant-ligatures: no-common-ligatures" class="">// This version uses name_type_mask = eFunctionNameTypeAuto</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span><span style="font-variant-ligatures: no-common-ligatures" class="">lldb</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures" class="">SBBreakpoint</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  BreakpointCreateByName(</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">char</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *symbol_name,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                         </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">SBFileSpecList</span><span style="font-variant-ligatures: no-common-ligatures" class=""> &module_list,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                         </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">SBFileSpecList</span><span style="font-variant-ligatures: no-common-ligatures" class=""> &comp_unit_list);</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">With a breakpoint options class we would add:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">  </span><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">lldb</span><span style="font-variant-ligatures: no-common-ligatures;" class="">::</span><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">SBBreakpoint</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">  BreakpointCreateByName(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">const</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">char</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> *symbol_name,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">                         lldb::SBBreakpointOptions &options);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><br class=""></div></div><div class=""><br class=""></div><div class="">Then we can make <span style="font-size: 11px;" class="">SBBreakpointOptions be able to set any kinds of filters we want.</span></div><div class=""><span style="font-size: 11px;" class=""><br class=""></span></div><div class=""><span style="font-size: 11px;" class="">The missing things that come to mind are:</span></div><div class=""><span style="font-size: 11px;" class="">- don't skip prologue</span></div><div class=""><span style="font-size: 11px;" class="">- don't set inlined breakpoints (concrete only) (this is missing in the command line interface as well)</span></div><div class=""><span style="font-size: 11px;" class="">- limiting to certain files or shared libraries (only available on some SBTarget::BreakpointCreateXXX() functions)</span></div><div class=""><span style="font-size: 11px;" class="">- thread specific settings</span></div><div class=""><span style="font-size: 11px;" class="">- hit count</span></div><div class=""><span style="font-size: 11px;" class="">- skip count</span></div><div class=""><span style="font-size: 11px;" class="">- setting condition on breakpoint right away instead of making another API call</span></div><div class=""><span style="font-size: 11px;" class=""><br class=""></span></div><div class=""><div><blockquote type="cite" class=""><div class="">On Oct 25, 2017, at 6:15 AM, Don Hinton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">I'd also like to include the path in the pattern, e.g., -f "*/clang/*", which would cut the number of files examined by about half for my use case.</div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 24, 2017 at 7:24 PM, Zachary Turner <span dir="ltr" class=""><<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Pass a pattern to the -f option.  </div><div class="HOEnZb"><div class="h5"><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Oct 24, 2017 at 7:18 PM Don Hinton <<a href="mailto:hintonda@gmail.com" target="_blank" class="">hintonda@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Do you mean just pass a pattern to the -f option or FileSpec?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 24, 2017 at 6:50 PM, Zachary Turner <span dir="ltr" class=""><<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div dir="auto" class="">It might be worth brainstorming if there’s ways to do this that are both intuitive and don’t require more options.  As a command line user, I really value my keystrokes.  </div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">One idea would be to use a syntax that matches that of the ‘-name’ option to the standard ‘find’ utility.  This way filename pattern matching would work in a way familiar to almost everyone, no sb api options would need to be added.</div></div><div class="m_-4793666632230900988m_8979516551163716867HOEnZb"><div class="m_-4793666632230900988m_8979516551163716867h5"><div dir="auto" class=""><br class=""></div><div dir="auto" class=""><br class=""></div><div class=""><div class=""><br class=""><div class="gmail_quote"><div class="">On Mon, Oct 23, 2017 at 6:25 PM Jim Ingham via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah, that would be easy to implement from the command line, maybe add a --file-is-regex flag or something.<br class="">
<br class="">
From the SB API it would be better to have something like:<br class="">
<br class="">
SBFileList SBTarget.<wbr class="">GetFileListMatchingRegex("<wbr class="">regex")<br class="">
<br class="">
Please file an enhancement request for these of hack'em in if you're so motivated.<br class="">
<br class="">
Jim<br class="">
<br class="">
<br class="">
> On Oct 23, 2017, at 6:13 PM, Don Hinton <<a href="mailto:hintonda@gmail.com" target="_blank" class="">hintonda@gmail.com</a>> wrote:<br class="">
><br class="">
> Ah, great, thanks.  I just figured the default was the same for both.<br class="">
><br class="">
> Just wish I could use a regex for the filename as well, which would cut down the number of files about about half.<br class="">
><br class="">
> thanks again...<br class="">
> don<br class="">
><br class="">
> On Mon, Oct 23, 2017 at 6:02 PM, Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank" class="">jingham@apple.com</a>> wrote:<br class="">
> Just pass an invalid FileSpec for the source file spec, like:<br class="">
><br class="">
> lldb.target.<wbr class="">BreakpointCreateBySourceRegex(<wbr class="">"printf", lldb.SBFileSpec())<br class="">
><br class="">
> and it acts the same way as the --all-files option.  That was pretty non-obvious, I'll update the docs.<br class="">
><br class="">
> Actually, the thing you CAN'T do is get the command line behavior where lldb uses the "default file" i.e. when you run "break set -p" but don't supply a file or the --all-files option.  That seemed to me less useful for a programming interface since the default file is history dependent (it's the file with "main" in it before you run, then it's where you last set a breakpoint, or where you last stopped, etc.)  If you needed this behavior it would be better to have the target vend the default file, though right now that's really only maintained by the breakpoint command...<br class="">
><br class="">
> Jim<br class="">
><br class="">
><br class="">
> > On Oct 23, 2017, at 5:31 PM, Don Hinton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class="">
> ><br class="">
> > The only way I've been able to do it is by using the CommandInterpreter, i.e.,<br class="">
> ><br class="">
> >   res = lldb.SBCommandReturnObject()<br class="">
> >   lldb.debugger.<wbr class="">GetCommandInterpreter().<wbr class="">HandleCommand('breakpoint set -p "diag::%s" --all-files -N %s' % (name, name), res);<br class="">
> >   lldb.debugger.<wbr class="">GetCommandInterpreter().<wbr class="">HandleCommand('breakpoint disable %s' % name, res);<br class="">
> ><br class="">
> > Is this the best way to do it?  Can't seem to figure out how to use SBTarget.<wbr class="">BreakpointCreateBySourceRegex(<wbr class="">) for all files.<br class="">
> ><br class="">
> > thanks...<br class="">
> > don<br class="">
> > ______________________________<wbr class="">_________________<br class="">
> > lldb-dev mailing list<br class="">
> > <a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class="">
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/lldb-dev</a><br class="">
><br class="">
><br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
lldb-dev mailing list<br class="">
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/lldb-dev</a><br class="">
</blockquote></div></div></div>
</div></div></blockquote></div><br class=""></div>
</blockquote></div>
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br class=""></div></blockquote></div><br class=""></div></body></html>