aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2015-05-28 10:19:30 +0100
committerYao Qi <yao.qi@linaro.org>2015-05-28 10:19:30 +0100
commit330c6ca9a034902cb0e7c7a9f64af651f39b5bf9 (patch)
treea90bcc35688f372d003b09d66a31263c6a823363 /gdb/arm-tdep.c
parentd403db2720ef6ac091dd1c0101ffc60242199528 (diff)
downloadfsf-binutils-gdb-330c6ca9a034902cb0e7c7a9f64af651f39b5bf9.zip
fsf-binutils-gdb-330c6ca9a034902cb0e7c7a9f64af651f39b5bf9.tar.gz
fsf-binutils-gdb-330c6ca9a034902cb0e7c7a9f64af651f39b5bf9.tar.bz2
Remove global variable arm_linux_vfp_register_count in arm-linux-nat.c
This patch is to remove the global variable arm_linux_vfp_register_count from arm-linux-nat.c. This global variable is set when native gdb looks for the right target description according HWCAP. However, 'struct gdbarch_tdep' has already had a field have_vfp_registers, which is a boolean about whether target has vfp registers or not. This patch converts this boolean field to a numeric counter to replace global variable arm_linux_vfp_register_count. gdb: 2015-05-28 Yao Qi <yao.qi@linaro.org> * arm-linux-nat.c (arm_linux_vfp_register_count): Remove. (fetch_vfp_regs): Use vfp_register_count from gdbarch_tdep instead of arm_linux_vfp_register_count. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. (arm_linux_read_description): Don't set arm_linux_vfp_register_count. * arm-linux-tdep.c (arm_linux_iterate_over_regset_sections): Adjust. * arm-tdep.c (arm_gdbarch_init): Add assert on vfp_register_count. * arm-tdep.h (struct gdbarch_tdep) <have_vfp_registers>: Rename field to vfp_register_count. All users updated.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 750749d..4011de8 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9914,7 +9914,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
enum arm_float_model fp_model = arm_fp_model;
struct tdesc_arch_data *tdesc_data = NULL;
int i, is_m = 0;
- int have_vfp_registers = 0, have_vfp_pseudos = 0, have_neon_pseudos = 0;
+ int vfp_register_count = 0, have_vfp_pseudos = 0, have_neon_pseudos = 0;
int have_neon = 0;
int have_fpa_registers = 1;
const struct target_desc *tdesc = info.target_desc;
@@ -10220,7 +10220,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (tdesc_unnumbered_register (feature, "s0") == 0)
have_vfp_pseudos = 1;
- have_vfp_registers = 1;
+ vfp_register_count = i;
/* If we have VFP, also check for NEON. The architecture allows
NEON without VFP (integer vector operations only), but GDB
@@ -10289,7 +10289,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->fp_model = fp_model;
tdep->is_m = is_m;
tdep->have_fpa_registers = have_fpa_registers;
- tdep->have_vfp_registers = have_vfp_registers;
+ gdb_assert (vfp_register_count == 0
+ || vfp_register_count == 16
+ || vfp_register_count == 32);
+ tdep->vfp_register_count = vfp_register_count;
tdep->have_vfp_pseudos = have_vfp_pseudos;
tdep->have_neon_pseudos = have_neon_pseudos;
tdep->have_neon = have_neon;