[PATCH-ppc 2/5] Add VSX support for core-files
Luis Machado
luisgpm@linux.vnet.ibm.com
Fri Aug 22 22:32:00 GMT 2008
Hi,
Attached is a patch that fixes the seen regression. OK?
Thanks,
Luis
On Thu, 2008-08-21 at 23:13 +0200, Ulrich Weigand wrote:
> Luis Machado wrote:
>
> > A new check should suffice for that. We will need three kinds of sets
> > then: VSX-able, VMX-able and neither VSX or VMX. How does it sound?
>
> That sounds right.
>
> Thanks,
> Ulrich
>
---
2008-08-22 Luis Machado <luisgpm@br.ibm.com>
* ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) New structure.
(ppc_linux_vmx_regset_sections): New structure.
(ppc_linux_fp_regset_sections): New structure.
(ppc_linux_init_abi): Select core-file regset based on target
features.
Index: gdb/ppc-linux-tdep.c
===================================================================
--- gdb.orig/ppc-linux-tdep.c 2008-08-22 15:12:04.000000000 -0700
+++ gdb/ppc-linux-tdep.c 2008-08-22 15:22:42.000000000 -0700
@@ -491,7 +491,7 @@
return ppc64_desc_entry_point (desc);
}
-static struct core_regset_section ppc_linux_regset_sections[] =
+static struct core_regset_section ppc_linux_vsx_regset_sections[] =
{
{ ".reg", 268 },
{ ".reg2", 264 },
@@ -500,6 +500,21 @@
{ NULL, 0}
};
+static struct core_regset_section ppc_linux_vmx_regset_sections[] =
+{
+ { ".reg", 268 },
+ { ".reg2", 264 },
+ { ".reg-ppc-vmx", 544 },
+ { NULL, 0}
+};
+
+static struct core_regset_section ppc_linux_fp_regset_sections[] =
+{
+ { ".reg", 268 },
+ { ".reg2", 264 },
+ { NULL, 0}
+};
+
static CORE_ADDR
ppc64_standard_linkage2_target (struct frame_info *frame,
CORE_ADDR pc, unsigned int *insn)
@@ -1103,7 +1118,14 @@
set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
/* Supported register sections. */
- set_gdbarch_core_regset_sections (gdbarch, ppc_linux_regset_sections);
+ if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.vsx"))
+ set_gdbarch_core_regset_sections (gdbarch, ppc_linux_vsx_regset_sections);
+ else if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.altivec"))
+ set_gdbarch_core_regset_sections (gdbarch, ppc_linux_vmx_regset_sections);
+ else
+ set_gdbarch_core_regset_sections (gdbarch, ppc_linux_fp_regset_sections);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
More information about the Gdb-patches
mailing list