This patch adds support for the Target Address Register for powerpc linux native and core file targets, and in the powerpc linux server stub. gdb/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * arch/ppc-linux-tdesc.h (tdesc_powerpc_isa207_vsx32l) (tdesc_powerpc_isa207_vsx64l): Declare. * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_TARREGSET): Define. (struct ppc_linux_features) <isa207>: New field. (ppc_linux_no_features): Add initializer for isa207 field. * arch/ppc-linux-common.c (ppc_linux_match_description): Return new tdescs. * nat/ppc-linux.h (PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_TAR) (NT_PPC_TAR): Define if not already defined. * features/Makefile (WHICH): Add rs6000/powerpc-isa207-vsx32l and rs6000/powerpc-isa207-vsx64l. (XMLTOC): Add rs6000/powerpc-isa207-vsx32l.xml and rs6000/powerpc-isa207-vsx64l.xml. * features/rs6000/power-tar.xml: New file. * features/rs6000/powerpc-isa207-vsx32l.xml: New file. * features/rs6000/powerpc-isa207-vsx64l.xml: New file. * features/rs6000/powerpc-isa207-vsx32l.c: Generate. * features/rs6000/powerpc-isa207-vsx64l.c: Generate. * regformats/rs6000/powerpc-isa207-vsx32l.dat: Generate. * regformats/rs6000/powerpc-isa207-vsx64l.dat: Generate. * ppc-linux-nat.c (fetch_register, fetch_ppc_registers): Call fetch_regset with the TAR regset. (store_register, store_ppc_registers): Call store_regset with the TAR regset. (ppc_linux_nat_target::read_description): Set isa207 field in the features struct if needed. * ppc-linux-tdep.c: Include features/rs6000/powerpc-isa207-vsx32l.c and features/rs6000/powerpc-isa207-vsx64l.c. (ppc32_regmap_tar, ppc32_linux_tarregset): New globals. (ppc_linux_iterate_over_regset_sections): Call back with the tar regset. (ppc_linux_core_read_description): Check if the tar section is present and set isa207 in the features struct. (_initialize_ppc_linux_tdep): Call initialize_tdesc_powerpc_isa207_vsx32l and initialize_tdesc_powerpc_isa207_vsx64l. * ppc-linux-tdep.h (ppc32_linux_tarregset): Declare. * ppc-tdep.h (gdbarch_tdep) <ppc_tar_regnum>: New field. (enum) <PPC_TAR_REGNUM>: New enum value. * rs6000-tdep.c (rs6000_gdbarch_init): Look for and validate tar feature. (ppc_process_record_op31): Record changes to TAR. gdb/gdbserver/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Add powerpc-isa207-vsx64l-ipa.o and powerpc-isa207-vsx32l-ipa.o. (powerpc*-*-linux*): Add powerpc-isa207-vsx32l.o and powerpc-isa207-vsx64l.o to srv_regobj, add rs6000/power-tar.xml, rs6000/powerpc-isa207-vsx32l.xml, and rs6000/powerpc-isa207-vsx64l.xml to srv_xmlfiles. * linux-ppc-tdesc-init.h (enum ppc_linux_tdesc) <PPC_TDESC_ISA207_VSX>: New enum value. (init_registers_powerpc_isa207_vsx32l): Declare. (init_registers_powerpc_isa207_vsx64l): Declare. * linux-ppc-low.c (ppc_fill_tarregset): New function. (ppc_store_tarregset): New function. (ppc_regsets): Add entry for the TAR regset. (ppc_arch_setup): Set isa207 in features struct when needed. Set size for the TAR regsets. (ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA207_VSX. (initialize_low_arch): Call init_registers_powerpc_isa207_vsx32l and init_registers_powerpc_isa207_vsx64l. * linux-ppc-ipa.c (get_ipa_tdesc): Handle PPC_TDESC_ISA207_VSX. (initialize_low_tracepoint): Call init_registers_powerpc_isa207_vsx32l and init_registers_powerpc_isa207_vsx64l. gdb/testsuite/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.arch/powerpc-tar.c: New file. * gdb.arch/powerpc-tar.exp: New file. gdb/doc/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Describe new feature "org.gnu.gdb.power.tar".
113 lines
3.3 KiB
C
113 lines
3.3 KiB
C
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef PPC_LINUX_H
|
|
#define PPC_LINUX_H 1
|
|
|
|
#include <asm/ptrace.h>
|
|
#include <asm/cputable.h>
|
|
|
|
/* This sometimes isn't defined. */
|
|
#ifndef PT_ORIG_R3
|
|
#define PT_ORIG_R3 34
|
|
#endif
|
|
#ifndef PT_TRAP
|
|
#define PT_TRAP 40
|
|
#endif
|
|
|
|
/* The PPC_FEATURE_* defines should be provided by <asm/cputable.h>.
|
|
If they aren't, we can provide them ourselves (their values are fixed
|
|
because they are part of the kernel ABI). They are used in the AT_HWCAP
|
|
entry of the AUXV. */
|
|
#ifndef PPC_FEATURE_CELL
|
|
#define PPC_FEATURE_CELL 0x00010000
|
|
#endif
|
|
#ifndef PPC_FEATURE_BOOKE
|
|
#define PPC_FEATURE_BOOKE 0x00008000
|
|
#endif
|
|
#ifndef PPC_FEATURE_HAS_DFP
|
|
#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal Floating Point. */
|
|
#endif
|
|
#ifndef PPC_FEATURE_HAS_VSX
|
|
#define PPC_FEATURE_HAS_VSX 0x00000080
|
|
#endif
|
|
#ifndef PPC_FEATURE_HAS_ALTIVEC
|
|
#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
|
|
#endif
|
|
#ifndef PPC_FEATURE_HAS_SPE
|
|
#define PPC_FEATURE_HAS_SPE 0x00800000
|
|
#endif
|
|
#ifndef PPC_FEATURE2_DSCR
|
|
#define PPC_FEATURE2_DSCR 0x20000000
|
|
#endif
|
|
#ifndef PPC_FEATURE2_ARCH_2_07
|
|
#define PPC_FEATURE2_ARCH_2_07 0x80000000
|
|
#endif
|
|
#ifndef PPC_FEATURE2_TAR
|
|
#define PPC_FEATURE2_TAR 0x04000000
|
|
#endif
|
|
|
|
/* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
|
|
configure time check. Some older glibc's (for instance 2.2.1)
|
|
don't have a specific powerpc version of ptrace.h, and fall back on
|
|
a generic one. In such cases, sys/ptrace.h defines
|
|
PTRACE_GETFPXREGS and PTRACE_SETFPXREGS to the same numbers that
|
|
ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and
|
|
PTRACE_SETVRREGS to be. This also makes a configury check pretty
|
|
much useless. */
|
|
|
|
/* These definitions should really come from the glibc header files,
|
|
but Glibc doesn't know about the vrregs yet. */
|
|
#ifndef PTRACE_GETVRREGS
|
|
#define PTRACE_GETVRREGS 18
|
|
#define PTRACE_SETVRREGS 19
|
|
#endif
|
|
|
|
/* PTRACE requests for POWER7 VSX registers. */
|
|
#ifndef PTRACE_GETVSXREGS
|
|
#define PTRACE_GETVSXREGS 27
|
|
#define PTRACE_SETVSXREGS 28
|
|
#endif
|
|
|
|
/* Similarly for the ptrace requests for getting / setting the SPE
|
|
registers (ev0 -- ev31, acc, and spefscr). See the description of
|
|
gdb_evrregset_t for details. */
|
|
#ifndef PTRACE_GETEVRREGS
|
|
#define PTRACE_GETEVRREGS 20
|
|
#define PTRACE_SETEVRREGS 21
|
|
#endif
|
|
|
|
/* Target Address Register. */
|
|
#ifndef NT_PPC_TAR
|
|
#define NT_PPC_TAR 0x103
|
|
#endif
|
|
|
|
/* Program Priority Register. */
|
|
#ifndef NT_PPC_PPR
|
|
#define NT_PPC_PPR 0x104
|
|
#endif
|
|
|
|
/* Data Stream Control Register. */
|
|
#ifndef NT_PPC_DSCR
|
|
#define NT_PPC_DSCR 0x105
|
|
#endif
|
|
|
|
/* Return the wordsize of the target, either 4 or 8 bytes. */
|
|
int ppc_linux_target_wordsize (int tid);
|
|
|
|
#endif
|