gdb: make gdbarch.sh write gdbarch.{c,h} directly
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 May 2020 21:18:25 +0000 (17:18 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sun, 24 May 2020 15:11:36 +0000 (11:11 -0400)
commit41a77cbaadd63b92362f5ea35b2cd11f90edf170
tree90873d1b17f04d3a6a6117dfe0c8a26dbd0a674b
parente08bd6c5081f4957ddb60117ac94775dcd618db7
gdb: make gdbarch.sh write gdbarch.{c,h} directly

It was suggested in this thread [1] that gdbarch.sh should write to
gdbarch.h and gdbarch.c directly.  This patch implements that.

When running gdbarch.sh, we currently need to move new-gdbarch.c over
gdbarch.c and new-gdbarch.h over gdbarch.h.  It might have been useful
at some point to not have gdbarch.sh overwrite gdbarch.h and gdbarch.c,
but with git it's really unnecessary.  Any changes to gdbarch.sh can be
inspected using `git diff`.

A next step would be to have the Makefile automatically run gdbarch.sh
if it sees that gdbarch.c and gdbarch.h are out of date.  Or maybe even
remove gdbarch.c and gdbarch.h from the tree and generate them in the
build directory when building.  But that requires more thinking and
discussions, and I think that this change is already useful in itself.

[1] https://sourceware.org/pipermail/gdb-patches/2020-May/168265.html

gdb/ChangeLog;

* gdbarch.sh: Write to gdbarch.c/gdbarch.h directly.  Don't
compare old and new versions.
(compare_new): Remove.

Change-Id: I7970a9e8af0afc0145cb5a28e73d94fbaa1e25b9
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
This page took 0.02442 seconds and 4 git commands to generate.