Commit Graph

4 Commits

Author SHA1 Message Date
Tom Tromey 7bc02706c3 Avoid -Wnarrowing warnings in struct tramp_frame instances
This avoids -Wnarrowing warnings in struct tramp_frame instances,
replacing uses of -1 with a new ULONGEST_MAX.  It also redefined
TRAMP_SENTINEL_INSN to avoid the same warning.

gdb/ChangeLog
2018-08-27  Tom Tromey  <tom@tromey.com>

	* tramp-frame.h (TRAMP_SENTINEL_INSN): Redefine.
	* tilegx-linux-tdep.c (tilegx_linux_rt_sigframe): Use
	ULONGEST_MAX.
	* tic6x-linux-tdep.c (tic6x_linux_rt_sigreturn_tramp_frame): Use
	ULONGEST_MAX.
	* sparc64-linux-tdep.c (sparc64_linux_rt_sigframe): Use
	ULONGEST_MAX.
	* sparc-linux-tdep.c (sparc32_linux_sigframe)
	(sparc32_linux_rt_sigframe): Use ULONGEST_MAX.
	* ppc-nbsd-tdep.c (ppcnbsd_sigtramp, ppcnbsd2_sigtramp): Use
	ULONGEST_MAX.
	* ppc-linux-tdep.c (ppc32_linux_sigaction_tramp_frame)
	(ppc64_linux_sigaction_tramp_frame)
	(ppc32_linux_sighandler_tramp_frame)
	(ppc64_linux_sighandler_tramp_frame): Use ULONGEST_MAX.
	* nios2-linux-tdep.c (nios2_r1_linux_rt_sigreturn_tramp_frame)
	(nios2_r2_linux_rt_sigreturn_tramp_frame): Use ULONGEST_MAX.
	* mn10300-linux-tdep.c (am33_linux_sigframe)
	(am33_linux_rt_sigframe): Use ULONGEST_MAX.
	* mips64-obsd-tdep.c (mips64obsd_sigframe): Use ULONGEST_MAX.
	* mips-linux-tdep.c (mips_linux_o32_sigframe)
	(mips_linux_o32_rt_sigframe, mips_linux_n32_rt_sigframe)
	(mips_linux_n64_rt_sigframe, micromips_linux_o32_sigframe)
	(micromips_linux_o32_rt_sigframe, micromips_linux_n32_rt_sigframe)
	(micromips_linux_n64_rt_sigframe): Use ULONGEST_MAX.
	* mips-fbsd-tdep.c (mips_fbsd_sigframe, mipsn32_fbsd_sigframe)
	(mips64_fbsd_sigframe): Use ULONGEST_MAX.
	* microblaze-linux-tdep.c
	(microblaze_linux_sighandler_tramp_frame): Use ULONGEST_MAX.
	* i386-nbsd-tdep.c (i386nbsd_sigtramp_sc16, i386nbsd_sigtramp_sc2)
	(i386nbsd_sigtramp_si2, i386nbsd_sigtramp_si31)
	(i386nbsd_sigtramp_si4): Use ULONGEST_MAX.
	* hppa-nbsd-tdep.c (hppanbsd_sigtramp_si4): Use ULONGEST_MAX.
	* common/common-types.h (ULONGEST_MAX): New define.
	(CORE_ADDR_MAX): Fix formatting.
	* bfin-linux-tdep.c (bfin_linux_sigframe): Use ULONGEST_MAX.
	* arm-obsd-tdep.c (armobsd_sigframe): Use ULONGEST_MAX.
	* arm-linux-tdep.c (arm_linux_sigreturn_tramp_frame)
	(arm_linux_rt_sigreturn_tramp_frame)
	(arm_eabi_linux_sigreturn_tramp_frame)
	(arm_eabi_linux_rt_sigreturn_tramp_frame)
	(thumb2_eabi_linux_sigreturn_tramp_frame)
	(thumb2_eabi_linux_rt_sigreturn_tramp_frame)
	(arm_linux_restart_syscall_tramp_frame)
	(arm_kernel_linux_restart_syscall_tramp_frame): Use ULONGEST_MAX.
	* arm-fbsd-tdep.c (arm_fbsd_sigframe): Use ULONGEST_MAX.
	* aarch64-linux-tdep.c (aarch64_linux_rt_sigframe): Use
	ULONGEST_MAX.
	* aarch64-fbsd-tdep.c (aarch64_fbsd_sigframe): Use ULONGEST_MAX.
2018-08-27 12:00:10 -06:00
Alan Hayward a616bb9450 Split size in regset section iterators
In the existing code, when using the regset section iteration functions, the
size parameter is used in different ways.

With collect, size is used to create the buffer in which to write the regset.
(see linux-tdep.c::linux_collect_regset_section_cb).

With supply, size is used to confirm the existing regset is the correct size.
If REGSET_VARIABLE_SIZE is set then the regset can be bigger than size.
Effectively, size is the minimum possible size of the regset.
(see corelow.c::get_core_register_section).

There are currently no targets with both REGSET_VARIABLE_SIZE and a collect
function.
In SVE, a corefile can contain one of two formats after the header, both of
which are different sizes. However, when writing a core file, we always want
to write out the full bigger size.

To allow support of collects for REGSET_VARIABLE_SIZE we need two sizes.
This is done by adding supply_size and collect_size.

gdb/

	* aarch64-fbsd-tdep.c
	(aarch64_fbsd_iterate_over_regset_sections): Add supply_size and
	collect_size.
	* aarch64-linux-tdep.c
	(aarch64_linux_iterate_over_regset_sections): Likewise.
	* alpha-linux-tdep.c
	(alpha_linux_iterate_over_regset_sections):
	* alpha-nbsd-tdep.c
	(alphanbsd_iterate_over_regset_sections): Likewise.
	* amd64-fbsd-tdep.c
	(amd64fbsd_iterate_over_regset_sections): Likewise.
	* amd64-linux-tdep.c
	(amd64_linux_iterate_over_regset_sections): Likewise.
	* arm-bsd-tdep.c
	(armbsd_iterate_over_regset_sections): Likewise.
	* arm-fbsd-tdep.c
	(arm_fbsd_iterate_over_regset_sections): Likewise.
	* arm-linux-tdep.c
	(arm_linux_iterate_over_regset_sections): Likewise.
	* corelow.c (get_core_registers_cb): Likewise.
	(core_target::fetch_registers): Likewise.
	* fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise.
	* frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise.
	* gdbarch.h (void): Regenerate.
	* gdbarch.sh: Add supply_size and collect_size.
	* hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise.
	* hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise.
	* hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise.
	* i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise.
	* i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
	* i386-tdep.c (i386_iterate_over_regset_sections): Likewise.
	* ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise.
	* linux-tdep.c (linux_collect_regset_section_cb): Likewise.
	* m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise.
	* m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise.
	* m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise.
	* mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise.
	* mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise.
	* mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise.
	* mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise.
	* mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise.
	* nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise.
	* ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise.
	* ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise.
	* ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise.
	* ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise.
	* riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise.
	* rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise.
	* s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise.
	* score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise.
	* sh-tdep.c (sh_iterate_over_regset_sections): Likewise.
	* sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise.
	* tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise.
	* vax-tdep.c (vax_iterate_over_regset_sections): Likewise.
	* xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.
2018-08-13 10:16:41 +01:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
John Baldwin 7176dfd28d Add FreeBSD/arm architecture.
Support for collecting and supplying general purpose and floating
point registers is provided along with signal frame unwinding.  While
FreeBSD/arm kernels do populate NT_FPREGSET notes, they are always
zero-filled, so this implementation ignores them.  Recent FreeBSD/arm
kernels generate NT_ARM_VFP notes which are used to supply
floating-point registers.  As with Linux, the AT_HWCAP feature flags
are used to determine the correct target description.

gdb/ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Add arm-fbsd-tdep.o.
	(ALLDEPFILES): Add arm-fbsd-tdep.c.
	* NEWS: Mention new FreeBSD/arm target.
	* configure.tgt: Add arm*-*-freebsd*.
	* arm-fbsd-tdep.c: New file.
	* arm-fbsd-tdep.h: New file.
2017-10-11 11:16:34 -07:00