[RFA 01/10] Add a selftest that detects a 'corrupted' command tree structure in GDB.

Tom Tromey tom@tromey.com
Thu May 14 15:51:53 GMT 2020


>>>>> "Philippe" == Philippe Waroquiers via Gdb-patches <gdb-patches@sourceware.org> writes:

Philippe> This commit introduces a selftest that detects (at least some cases of) errors
Philippe> leading to 'next' and '*prefixlist' not giving a tree structure.

Thank you.

Philippe> +/* Verify that a list of commands is present in the tree only once.  */
Philippe> +
Philippe> +static void
Philippe> +command_structure_invariants_tests ()
Philippe> +{
Philippe> +
Philippe> +  traverse_command_structure (&cmdlist, "");

Spurious blank line after the "{".

Philippe> +
Philippe> +  /* Release memory, be ready to be re-run.  */
Philippe> +  lists.clear ();
Philippe> +
Philippe> +  SELF_CHECK (nr_duplicates == 0);

This should also reset nr_duplicates.

Tom


More information about the Gdb-patches mailing list