[PATCH 0/8] Rewrite gdbarch.sh in Python
Tom Tromey
tom@tromey.com
Wed Dec 15 22:45:05 GMT 2021
I was annoyed with gdbarch.sh recently, and so I spent some time
looking into whether it could be replaced with a ".def"-style file and
then a bunch of macros. While I do think this could probably be
accomplished, it would require some very ugly macrology.
Then, when discussing this on irc, Simon pointed out that he had
started rewriting gdbarch.sh in Python. This series takes his initial
patch and finishes it.
There are a few benefits to this change:
1. It's much easier to edit the new file. It's ordinary code with
keyword arguments, rather than a single cryptic line in the middle
of the .sh file. The new format is even documented
2. Boilerplate code is moved out of the generator and into ordinary
files. This makes it simpler to work on, should that be needed.
3. The new generator is much, much faster -- around 100x. It no
longer takes seconds to run, it is instantaneous.
I tested this by rebuilding, and by examining the changes to the
generated code. See patch #7 for that.
Let me know what you think.
Tom
More information about the Gdb-patches
mailing list