[PATCH 00/46] Rewrite "require" test procedure and use it more often

Tom Tromey tom@tromey.com
Sat Dec 17 00:07:32 GMT 2022

A recent patch by Enze Li made me revisit the "require" procedure.
For his patch, see:


This series rewrites "require" to be a bit more 'static' and then
changes a lot of the test suite to use it when possible.  I looked at
a large number of tests, but not every single one, so it's possible
some more work here could be done.

The new 'require' just invokes simple predicates and decides what to
do based on them.  It will issue an "unsupported" message if the
requirements are not satisfied.  See patch #3.

Currently the requirements should only be invoked when gdb is not
running.  At least, that's what I've done, I don't think there's a
real barrier to doing this, other than the fact that the resulting
code might be overly subtle.

More changes here could be done, for example allowing uses like:

    require {is_remote host}

or the like.  I haven't tried this.

The main benefit of this entire approach is that it removes
boilerplate and decisions about whether to use verbose, unsupport,
untested, or even no output at all.

Regression tested on x86-64 Fedora 36, though TBH that's hardly

Let me know what you think.


More information about the Gdb-patches mailing list