Blame SOURCES/gdb-rhbz1187581-power8-regs-not-in-8-2-13of15.patch

ce65b8
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
ce65b8
From: Keith Seitz <keiths@redhat.com>
ce65b8
Date: Fri, 11 Jan 2019 17:02:18 -0500
ce65b8
Subject: gdb-rhbz1187581-power8-regs-not-in-8-2-13of15.patch
ce65b8
ce65b8
;; [PowerPC] Reject tdescs with VSX and no FPU or Altivec
ce65b8
;; Pedro Franco de Carvalho
ce65b8
ce65b8
    [PowerPC] Reject tdescs with VSX and no FPU or Altivec
ce65b8
ce65b8
    Currently rs6000_gdbarch_init will accept a tdesc with the
ce65b8
    "org.gnu.gdb.power.vsx" feature but without the
ce65b8
    "org.gnu.gdb.power.altivec" or "org.gnu.gdb.power.fpu".
ce65b8
ce65b8
    It isn't clear from the standard features documentation that these are
ce65b8
    requirements.  However, these tdescs would cause trouble in the VSX
ce65b8
    pseudo-register functions, so this patch will cause them to be
ce65b8
    rejected.
ce65b8
ce65b8
    gdb/ChangeLog:
ce65b8
    2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
ce65b8
ce65b8
        * rs6000-tdep.c (rs6000_gdbarch_init): Reject tdescs with vsx but
ce65b8
        without altivec or fpu.
ce65b8
ce65b8
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
ce65b8
--- a/gdb/rs6000-tdep.c
ce65b8
+++ b/gdb/rs6000-tdep.c
ce65b8
@@ -6096,7 +6096,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
ce65b8
 	    valid_p &= tdesc_numbered_register (feature, tdesc_data,
ce65b8
 						PPC_VSR0_UPPER_REGNUM + i,
ce65b8
 						vsx_regs[i]);
ce65b8
-	  if (!valid_p)
ce65b8
+
ce65b8
+	  if (!valid_p || !have_fpu || !have_altivec)
ce65b8
 	    {
ce65b8
 	      tdesc_data_cleanup (tdesc_data);
ce65b8
 	      return NULL;