[PATCH 0/7] Make gdbarch.sh shellcheck-clean

Tom Tromey tom@tromey.com
Mon May 11 16:55:35 GMT 2020


>>>>> "Pedro" == Pedro Alves via Gdb-patches <gdb-patches@sourceware.org> writes:

Pedro> My main gripe with gdbarch.sh is that the function/variable/method definitions
Pedro> and the generator code is all in the same file.

Pedro> If those were split to separate files, like, the definitions inside function_list()
Pedro> were moved to a separate gdbarch.def file, which would be read by gdbarch.sh,
Pedro> that'd already be a large win, IMHO.

Pedro> Also, I would like it to be able to generate the gdbarch.h/c files in place,
Pedro> instead of generating new "new-gdbarch.h/c" files.

Another option would be to go with a .def-style file, but using #include
and #define to turn it into C++ code, like we do with other files.

There's basically two things I don't like about the current setup.

One problem is that the current code is hard to read.  Any of the ideas
we've discussed would fix this.

The other problem is not just that the output files are new-gdbarch.[ch]
-- that can be fixed with a simple script tweak -- but that the script
has to be run manually to update & commit the output.  This bites me
occasionally; it would be preferable by far if it were simply integrated
into the build in a normal way.

This latter thing is a problem with make-target-delegates as well,
though I touch that one a lot less often, so it doesn't irritate as
much.

Tom


More information about the Gdb-patches mailing list