[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 30 17:32:25 PDT 2017


jingham added a comment.

In https://reviews.llvm.org/D39436#911304, @hintonda wrote:

> In https://reviews.llvm.org/D39436#911274, @jingham wrote:
>
> > BTW, to Z's comment: you can't really resolve the regex pattern when you make the breakpoint.  What if another library gets loaded later on, which has source files that match the source file pattern the user entered, and have source code that matches the -p pattern.  The breakpoint should be updated to encompass those new locations, but you can't do that if you've already matched the pattern against the original list of files, and then thrown away the pattern.
>
>
> Isn't this how it already works with all breakpoints?  If you load more modules, do more locations get automatically loaded?  Sorry if that's a dumb question.


That's how it should work.  Zachary was suggesting (though I don't think he is anymore) taking the pattern in as an argument, but then matching it against the files that matched the pattern at the time the breakpoint was set.  That is NOT - as you correctly state - the way breakpoints are supposed to work.  So if we want to make this a pattern, we have to store the pattern.

> 
> 
>> This needs to be maintained as a pattern in the breakpoint, if you want it to be an actual pattern.  But we shouldn't overload FileSpec for that purpose, IMO.
> 
> It already is a pattern if used without a path.

Not really.  If you don't supply a directory, I'm free to treat this as "the first one I find" if I want.  A regex is explicitly multiple files.


https://reviews.llvm.org/D39436





More information about the lldb-commits mailing list