public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Rewrite gdbarch.sh in Python
@ 2021-12-15 22:45 Tom Tromey
  2021-12-15 22:45 ` [PATCH 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-15 22:45 UTC (permalink / raw)
  To: gdb-patches

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



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-12-19  5:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 22:45 [PATCH 0/8] Rewrite gdbarch.sh in Python Tom Tromey
2021-12-15 22:45 ` [PATCH 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
2021-12-15 22:45 ` [PATCH 2/8] Split gdbarch.h into two files Tom Tromey
2021-12-15 22:45 ` [PATCH 3/8] Do not generate gdbarch.h Tom Tromey
2021-12-15 22:45 ` [PATCH 4/8] Do not sort the fields in gdbarch_dump Tom Tromey
2021-12-15 22:45 ` [PATCH 5/8] Generate new components.py from gdbarch.sh Tom Tromey
2021-12-16  1:31   ` Simon Marchi
2021-12-16 18:46     ` Tom Tromey
2021-12-17 16:41       ` Simon Marchi
2021-12-15 22:45 ` [PATCH 6/8] Add new gdbarch generator Tom Tromey
2021-12-16  2:01   ` Simon Marchi
2021-12-16 18:56     ` Tom Tromey
2021-12-16 18:57       ` Tom Tromey
2021-12-16 19:03         ` Tom Tromey
2021-12-15 22:45 ` [PATCH 7/8] Remove gdbarch.sh Tom Tromey
2021-12-15 22:45 ` [PATCH 8/8] Document components.py Tom Tromey
2021-12-16  1:46   ` Simon Marchi
2021-12-16 20:19     ` Tom Tromey
2021-12-16 18:02 ` [PATCH 0/8] Rewrite gdbarch.sh in Python John Baldwin
2021-12-16 19:13   ` Tom Tromey
2021-12-17 19:23     ` John Baldwin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).