Add new gdbarch generator
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 15 Dec 2021 20:17:44 +0000 (13:17 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 17 Dec 2021 22:07:09 +0000 (15:07 -0700)
commit7c8bb2ed1c220e0a8d7ae8dbb514e484c0573acb
tree5cf5cda9624f74a4eef85ac87e4b891bb7933dec
parent65b1aa7501ace4c58fb5062479c710d0bdff6f34
Add new gdbarch generator

The new gdbarch generator is a Python program.  It reads the
"components.py" that was created in the previous patch, and generates
gdbarch.c and gdbarch-gen.h.

This is a relatively straightforward translation of the existing .sh
code.  It doesn't try very hard to be idiomatic Python or to be
especially smart.

It is, however, incredibly faster:

    $ time ./gdbarch.sh

    real 0m8.197s
    user 0m5.779s
    sys 0m3.384s

    $ time ./gdbarch.py

    real 0m0.065s
    user 0m0.053s
    sys 0m0.011s

Co-Authored-By: Tom Tromey <tom@tromey.com>
gdb/gdbarch.py [new file with mode: 0755]