Re: [PATCH v2 18/24] dyndbg: allow negating flag-chars in modflags

From: Petr Mladek
Date: Tue Jun 16 2020 - 07:47:07 EST


On Sat 2020-06-13 09:57:32, Jim Cromie wrote:
> Extend flags modifications to allow [PFMLTU] negating flags.
> This allows control-queries like:
>
> #> Q () { echo file inode.c $* > control } # to type less
> #> Q -P # same as +p
> #> Q +U # same as -u
> #> Q u-P # same as u+p
>
> This allows flags in a callsite to be simultaneously set and cleared,
> while still starting with the current flagstate (with +- ops).
>
> Using filter-flags with negating-flags, you can select exactly the
> flagstates you want, both required and prohibited.
>
> Then with negating-flags in modflags, you can set and clear every flag
>
> #> Q umfLT-Pmf # select sites with u,m,f only. enable print, turn off m,f leave u
>
> Its not an important feature, but it does fill out the logic.
> and the patch is tiny, and feels more symmetrical.

I do not think that it is a good idea.

Many people do not like perl because it allows to do the same thing
many ways. The result is that the code is hard to read. There are too
many coding styles and tricks to understand.

Best Regards,
Petr