This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 06/25] Generate c for feature instead of tdesc
Eli Zaretskii <eliz@gnu.org> writes:
> Sorry, I don't understand: built into GDB how? The GDB in which the
> user runs this command can then turn around and have the produced file
> built into it?
Yes,
We feed GDB the XML target description file, let GDB print the c file,
and then include these generated c files in *-tdep.c. That is, in
gdb/features/Makefile, we have,
%.c: %.xml
$(GDB) -nx -q -batch \
-ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp
sh ../../move-if-change $@.tmp $@
it generates gdb/features/*.c files from the corresponding .xml files.
They are included in gdb source, like, in gdb/i386-linux-tdep.c,
#include "features/i386/i386-linux.c"
#include "features/i386/i386-mmx-linux.c"
#include "features/i386/i386-mpx-linux.c"
#include "features/i386/i386-avx-mpx-linux.c"
#include "features/i386/i386-avx-linux.c"
#include "features/i386/i386-avx-avx512-linux.c"
#include "features/i386/i386-avx-mpx-avx512-pku-linux.c"
--
Yao (齐尧)