From: D. J. B. <dj...@cr...> - 2025-05-10 14:06:46
|
This patch adds support for VALGRIND_TRY_OPTS that's like VALGRIND_OPTS but skips unsupported options. VALGRIND_TRY_OPTS is always after VALGRIND_OPTS. For more fine-grained control over order, there's also a new --try that skips the next option if the next option is unsupported. If support for --try is added to the forthcoming 3.26 via this patch, and then support for some specific --X is added in (say) valgrind 3.30 or valgrind 2027.10, then scripts can use --try --X to opportunistically enable --X without breaking 3.26, 3.27, 3.28, and 3.29. Of course, setting --X in VALGRIND_TRY_OPTS has the big advantage of also not breaking 3.25, 3.24, etc. Anyway, VALGRIND_TRY_OPTS is implemented internally on top of --try. The patch adds user-facing documentation of VALGRIND_TRY_OPTS and --try in docs/xml/manual-core.xml and in valgrind --help. This patch is on top of HEAD, and adds 18 tests for VALGRIND_TRY_OPTS and --try, while also tweaking a few existing tests to reflect the changes to --help. A full "make regtest" under Debian 12 on a Zen 2 shows no new failures compared to HEAD. The existing documentation of default options was missing a statement that default options don't work for pre-early options, and a statement that default options are disabled by --command-line-only=yes. This patch includes the missing documentation. This is conceptually separate from the rest of the patch, but I think anyone reviewing the code+tests for the rest of the patch will naturally end up bumping into these issues. ---D. J. Bernstein |