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

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 30 16:20:41 PDT 2017


zturner added a comment.

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

> In https://reviews.llvm.org/D39436#911237, @zturner wrote:
>
> > Hmm, weird.  Maybe it already is?  Even though I didn't see it on the original email.  Anyway, ignore my last suggestion.
> >
> > On to actual comments: I'm not really crazy about the `regex:` prefix.  Seems ugly and non-intuitive.  Couldn't we just treat every filename as an argument to `fnmatch (3)`?  Then you don't need any weird prefixes.  Besides, `regex:foo` is a valid filename so if we're going to be making it so that some arguments to `-f` all of a sudden have to be escaped because they're no longer interpreted literally, then we might as well do it in a way that's intuitive and people are already familiar with.
>
>
> The problem with -f and -s is that they create FileSpec's, and FileSpec has some special handling for paths, so I'm not sure how to handle this without a prefix.  Is there a delimiter that's invalid on all platforms?  I thought ':' would work since we use it for path delimiters, but I've only got a Mac to test on right now.  I suppose we could get really ugly and use a uri style prefix, e.g., "regex://".


Couldn't they create a *list* of FileSpecs?  Just glancing at the code for `-f`, it does this:

  case 'f':
    m_filenames.AppendIfUnique(FileSpec(option_arg, false));
    break;

So, just resolve the expression at this point and append more than one `FileSpec`?


https://reviews.llvm.org/D39436





More information about the lldb-commits mailing list