Commit Graph

2 Commits

Author SHA1 Message Date
Simon Marchi a8d2e5856f Do not emit "field_type" var if not needed on "maint print c-tdesc"
While fiddling a bit with -Wunused-variable, Sergio noticed that "maint
print c-tdesc" was always generating code for the "tdesc_type
*field_type" variable, even when it wasn't used.  This is caught by GCC
when using -Wunused-variable, of course.

This patch changes the print_c_tdesc class to only output the field
declaration when we actually need it.

It shouldn't be necessary to do the same with the other variable
declarations (type_with_fields and element_type), because they are
always if they are declared.

The C files in features/ are regenerated, some declarations of
field_type are removed, as expected, while some others move to where
they are used for the first time.

gdb/ChangeLog:

	* target-descriptions.c (print_c_tdesc) <visit>: Don't output
	field_type declaration, use printf_field_type_assignment
	instead.
	<printf_field_type_assignment>: New method.
	* features/aarch64-core.c, features/aarch64-fpu.c
	features/arc-arcompact.c, features/arc-v2.c,
	features/arm/arm-with-iwmmxt.c, features/i386/32bit-core.c,
	features/i386/32bit-mpx.c, features/i386/32bit-sse.c,
	features/i386/64bit-avx512.c, features/i386/64bit-core.c,
	features/i386/64bit-mpx.c, features/i386/64bit-sse.c,
	features/i386/x32-core.c, features/or1k.c,
	features/rs6000/powerpc-7400.c,
	features/rs6000/powerpc-altivec32.c,
	features/rs6000/powerpc-altivec32l.c,
	features/rs6000/powerpc-altivec64.c,
	features/rs6000/powerpc-altivec64l.c,
	features/rs6000/powerpc-cell32l.c,
	features/rs6000/powerpc-cell64l.c,
	features/rs6000/powerpc-isa205-altivec32l.c,
	features/rs6000/powerpc-isa205-altivec64l.c,
	features/rs6000/powerpc-isa205-vsx32l.c,
	features/rs6000/powerpc-isa205-vsx64l.c,
	features/rs6000/powerpc-vsx32.c,
	features/rs6000/powerpc-vsx32l.c,
	features/rs6000/powerpc-vsx64.c,
	features/rs6000/powerpc-vsx64l.c, features/s390-gs-linux64.c,
	features/s390-tevx-linux64.c, features/s390-vx-linux64.c,
	features/s390x-gs-linux64.c, features/s390x-tevx-linux64.c,
	features/s390x-vx-linux64.c: Re-generate.
2017-12-21 18:21:45 -05:00
Franck Jullien a994fec4f8 gdb: Add OpenRISC or1k and or1knd target support
This patch prepares the current GDB port of the OpenRISC processor from
https://github.com/openrisc/binutils-gdb for upstream merging.

Testing has been done with a cgen sim provided in a separate patch. This
has been tested with 2 toolchains. GCC [1] 5.4.0 from the OpenRISC
project with Newlib [2] and GCC 5.4.0 with Musl [3] 1.1.4.

It supports or1knd (no delay slot target).
The default target is or1k (with delay slot).

You can change the target arch with:

(gdb) set architecture or1knd
The target architecture is assumed to be or1knd

[1] https://github.com/openrisc/or1k-gcc
[2] https://github.com/openrisc/newlib
[3] https://github.com/openrisc/musl-cross

gdb/doc/ChangeLog:

2017-12-12  Stafford Horne  <shorne@gmail.com>
	    Stefan Wallentowitz  <stefan@wallentowitz.de>
	    Franck Jullien  <franck.jullien@gmail.com>
	    Jeremy Bennett  <jeremy.bennett@embecosm.com>

	* gdb.texinfo: Add OpenRISC documentation.

gdb/ChangeLog:

2017-12-12  Stafford Horne  <shorne@gmail.com>
	    Stefan Wallentowitz  <stefan@wallentowitz.de>
	    Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>
	    Franck Jullien  <franck.jullien@gmail.com>
	    Jeremy Bennett  <jeremy.bennett@embecosm.com>

	* configure.tgt: Add targets for or1k and or1knd.
	* or1k-tdep.c: New file.
	* or1k-tdep.h: New file.
	* features/Makefile: Add or1k.xml to build.
	* features/or1k.xml: New file.
	* features/or1k-core.xml: New file.
	* features/or1k.c: Generated.
2017-12-12 23:36:00 +09:00