[lldb-dev] Break setting aliases...
Pavel Labath via lldb-dev
lldb-dev at lists.llvm.org
Thu Jul 23 01:51:31 PDT 2020
On 22/07/2020 19:50, Jim Ingham wrote:
>> On Jul 22, 2020, at 12:34 AM, Pavel Labath <pavel at labath.sk> wrote:
>>
>> The "--" is slightly unfortunate, but it's at least consistent with our
>> other commands taking raw input. We could avoid that by making the
>> command not take raw input. I think most of the "modes" of the "b"
>> command wouldn't need quoting in most circumstances -- source regex and
>> "lib`func" modes being exceptions.
>
> If anybody wants to work on this, I think Jonas is right, the first step would be to convert it to an actual command not a regex command. The _regexp-break command is already hard enough to comprehend.
>
> You could still do the actual specifier parsing with a series of regex’s if that seems best, though there might be easier ways to do it. I also don’t think this would need to be a raw command, rather it could be a parsed command with one argument which was the breakpoint specifier and then all the other breakpoint flags.
>
> All the specifications you can currently pass to b are single words w/o spaces in them, or if they do have spaces they are the things you are used to having to quote in lldb: like file names with spaces.
The lib`func notation contains a backtick, which is used for expression
substitution in the command interpreter. Currently we seem to be just
dropping an unmatched backtick, which would break that. We could change
it so that the unmatched backtick is kept, though I would actually
prefer to make that an error..
>> "br set" help starts with a long list command switches, which are
>> supposed to show which options can be used together. I think this sort
>> of listing is nice when the command has a couple of modes and a few
>> switches, but it really misses the mark when it ends up listing 11 modes
>> with approximately 20 switches in each one.
>>
>> This is then followed by descriptions of the 20 or so switches. This
>> list is alphabetical, which means the most commonly used options end up
>> burried between the switches I've never even used.
>
> Yes. I’ve said many times before that making “break set” the master command for breakpoint setting was a mistake. ...
Restructuring the commands is one thing. It might be a good idea but
there are less invasive things we could do to make this better. Just
restructuring the help output to make the most common use cases easier
to find would help a lot IMO. We could drop or simplify the "synopsis"
section, maybe replacing it with a couple of examples of the most useful
kinds of breakpoints.
Then we could group the options to keep the similar ones together and
make them easier to find/skip. Maybe with groups like:
- options specifying where to set a breakpoint: --file, --line; --name; etc.
- options restricting the reported breakpoint hits:
--thread-id,--thread-name,--condition, etc.
- various modifiers: --disable, --hardware, --one-shot, etc.
- others (?)
The division may not be perfect (like, is --ignore-count a "modifier" or
does it "restrict breakpoint hits"?), but even so I think this would
make that list a lot easier to navigate. But we digress...
On 22/07/2020 20:20, Greg Clayton wrote:
> BTW: to see what things expand to after reach regex alias, just set
this setting first:
>
> (lldb) settings set interpreter.expand-regex-aliases true
That is cool. I wonder if that should be the default...
pl
More information about the lldb-dev
mailing list