Index: external/gpl3/gdb/dist/gdb/armnbsd-nat.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/armnbsd-nat.c,v retrieving revision 1.9 diff -u -p -r1.9 armnbsd-nat.c --- external/gpl3/gdb/dist/gdb/armnbsd-nat.c 18 Mar 2014 08:40:05 -0000 1.9 +++ external/gpl3/gdb/dist/gdb/armnbsd-nat.c 20 Apr 2014 08:56:38 -0000 @@ -594,6 +595,65 @@ fetch_elfcore_registers (struct regcache break; } } +static const struct target_desc * +arm_nbsd_read_description (struct target_ops *ops) +{ + return tdesc_arm_with_vfpv2; +#if 0 + CORE_ADDR arm_hwcap = 0; + arm_linux_has_wmmx_registers = 0; + arm_linux_vfp_register_count = 0; + + if (target_auxv_search (ops, AT_HWCAP, &arm_hwcap) != 1) + { + return NULL; + } + + if (arm_hwcap & HWCAP_IWMMXT) + { + arm_linux_has_wmmx_registers = 1; + return tdesc_arm_with_iwmmxt; + } + + if (arm_hwcap & HWCAP_VFP) + { + int pid; + char *buf; + const struct target_desc * result = NULL; + + /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support + Neon with VFPv3-D32. */ + if (arm_hwcap & HWCAP_NEON) + { + arm_linux_vfp_register_count = 32; + result = tdesc_arm_with_neon; + } + else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) + { + arm_linux_vfp_register_count = 32; + result = tdesc_arm_with_vfpv3; + } + else + { + arm_linux_vfp_register_count = 16; + result = tdesc_arm_with_vfpv2; + } + + /* Now make sure that the kernel supports reading these + registers. Support was added in 2.6.30. */ + pid = GET_LWP (inferior_ptid); + errno = 0; + buf = alloca (VFP_REGS_SIZE); + if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0 + && errno == EIO) + result = NULL; + + return result; + } + + return NULL; +#endif +} static struct core_fns arm_netbsd_core_fns = { @@ -622,6 +682,9 @@ _initialize_arm_netbsd_nat (void) t->to_fetch_registers = armnbsd_fetch_registers; t->to_store_registers = armnbsd_store_registers; t->to_pid_to_exec_file = nbsd_pid_to_exec_file; + + t->to_read_description = arm_nbsd_read_description; + add_target (t); /* Support debugging kernel virtual memory images. */