diff options
Diffstat (limited to 'gdb/arch')
-rw-r--r-- | gdb/arch/aarch32.c | 18 | ||||
-rw-r--r-- | gdb/arch/arm.c | 72 |
2 files changed, 64 insertions, 26 deletions
diff --git a/gdb/arch/aarch32.c b/gdb/arch/aarch32.c index 14d6987..1e21d5a 100644 --- a/gdb/arch/aarch32.c +++ b/gdb/arch/aarch32.c @@ -18,12 +18,26 @@ #include "gdbsupport/common-defs.h" #include "aarch32.h" -extern struct target_desc *tdesc_arm_with_neon; +#include "../features/arm/arm-core.c" +#include "../features/arm/arm-vfpv3.c" /* See aarch32.h. */ target_desc * aarch32_create_target_description () { - return tdesc_arm_with_neon; + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + + regnum = create_feature_arm_arm_core (tdesc, regnum); + /* Create a vfpv3 feature, then a blank NEON feature. */ + regnum = create_feature_arm_arm_vfpv3 (tdesc, regnum); + tdesc_create_feature (tdesc, "org.gnu.gdb.arm.neon"); + + return tdesc; } diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c index 7a0f36e..ea03dd1 100644 --- a/gdb/arch/arm.c +++ b/gdb/arch/arm.c @@ -21,16 +21,12 @@ #include "gdbsupport/common-regcache.h" #include "arm.h" -extern struct target_desc *tdesc_arm_with_vfpv2; -extern struct target_desc *tdesc_arm_with_vfpv3; -extern struct target_desc *tdesc_arm_with_iwmmxt; - -/* Temporary ifdef. Will be removed when target descriptions are switched. */ -#ifndef GDBSERVER -extern struct target_desc *tdesc_arm_with_m; -extern struct target_desc *tdesc_arm_with_m_vfp_d16; -extern struct target_desc *tdesc_arm_with_m_fpa_layout; -#endif +#include "../features/arm/arm-core.c" +#include "../features/arm/arm-vfpv2.c" +#include "../features/arm/arm-vfpv3.c" +#include "../features/arm/xscale-iwmmxt.c" +#include "../features/arm/arm-m-profile.c" +#include "../features/arm/arm-m-profile-with-fpa.c" /* See arm.h. */ @@ -389,24 +385,41 @@ shifted_reg_val (struct regcache *regcache, unsigned long inst, target_desc * arm_create_target_description (arm_fp_type fp_type) { + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + if (fp_type == ARM_FP_TYPE_IWMMXT) + set_tdesc_architecture (tdesc, "iwmmxt"); + else + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + + regnum = create_feature_arm_arm_core (tdesc, regnum); + switch (fp_type) { case ARM_FP_TYPE_NONE: - return nullptr; -/* Temporary ifdef. Will be removed when target descriptions are switched. */ -#ifndef GDBSERVER + break; + case ARM_FP_TYPE_VFPV2: - return tdesc_arm_with_vfpv2; + regnum = create_feature_arm_arm_vfpv2 (tdesc, regnum); + break; case ARM_FP_TYPE_VFPV3: - return tdesc_arm_with_vfpv3; + regnum = create_feature_arm_arm_vfpv3 (tdesc, regnum); + break; case ARM_FP_TYPE_IWMMXT: - return tdesc_arm_with_iwmmxt; -#endif + regnum = create_feature_arm_xscale_iwmmxt (tdesc, regnum); + break; + default: error (_("Invalid Arm FP type: %d"), fp_type); } + + return tdesc; } /* See arch/arm.h. */ @@ -414,21 +427,32 @@ arm_create_target_description (arm_fp_type fp_type) target_desc * arm_create_mprofile_target_description (arm_m_profile_type m_type) { + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + switch (m_type) { -/* Temporary ifdef. Will be removed when target descriptions are switched. */ -#ifndef GDBSERVER case ARM_M_TYPE_M_PROFILE: - return tdesc_arm_with_m; + regnum = create_feature_arm_arm_m_profile (tdesc, regnum); + break; case ARM_M_TYPE_VFP_D16: - return tdesc_arm_with_m_fpa_layout; + regnum = create_feature_arm_arm_m_profile (tdesc, regnum); + regnum = create_feature_arm_arm_vfpv2 (tdesc, regnum); + break; case ARM_M_TYPE_WITH_FPA: - return tdesc_arm_with_m_vfp_d16; -#endif + regnum = create_feature_arm_arm_m_profile_with_fpa (tdesc, regnum); + break; + default: error (_("Invalid Arm M type: %d"), m_type); } -} + return tdesc; +} |