fix GDB build failure for various amd64 targets
authorJoel Brobecker <brobecker@adacore.com>
Fri, 29 Jun 2018 22:42:27 +0000 (18:42 -0400)
committerJoel Brobecker <brobecker@adacore.com>
Fri, 29 Jun 2018 22:51:18 +0000 (18:51 -0400)
The following patch caused some amd64-*-tdep files to fail to compile:

  | commit de52b9607d2623f18b7a7dbee3e1123d8d63f5da
  | Date:   Tue Jun 26 16:33:27 2018 +0100
  | Subject: x86_64-windows GDB crash due to fs_base/gs_base registers

This is because we added one additional "segments" argument to
function amd64_target_description and forgot to update all the callers.
This patch fixes the omissions.

gdb/ChangeLog:

        * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Add missing
        parameter in call to amd64_target_description.
        * amd64-dicos-tdep.c (amd64_dicos_init_abi): Likewise.
        * amd64-fbsd-tdep.c (amd64fbsd_core_read_description)
        (amd64fbsd_init_abi): Likewise.
        * amd64-nbsd-tdep.c (amd64nbsd_init_abi): Likewise.
        * amd64-obsd-tdep.c (amd64obsd_init_abi): Likewise.
        * amd64-sol2-tdep.c (amd64_sol2_init_abi): Likewise.
        * amd64-fbsd-nat.c (amd64_fbsd_nat_target): Likewise.

The change to amd64-fbsd-nat.c was done "blind" (no access to system),
but is reasonably straightforward. The changes to the -tdep.c files
were verify by rebuilding GDB on x86_64-linux when configured with
--enable-targets=all.

gdb/ChangeLog
gdb/amd64-darwin-tdep.c
gdb/amd64-dicos-tdep.c
gdb/amd64-fbsd-nat.c
gdb/amd64-fbsd-tdep.c
gdb/amd64-nbsd-tdep.c
gdb/amd64-obsd-tdep.c
gdb/amd64-sol2-tdep.c

index c47c111466d393fb20fa766297e4e489175dc952..e3267853d37816f808d1a1db3ae064a562880035 100644 (file)
@@ -1,3 +1,15 @@
+2018-06-29  Joel Brobecker  <brobecker@adacore.com>
+
+       * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Add missing
+       parameter in call to amd64_target_description.
+       * amd64-dicos-tdep.c (amd64_dicos_init_abi): Likewise.
+       * amd64-fbsd-tdep.c (amd64fbsd_core_read_description)
+       (amd64fbsd_init_abi): Likewise.
+       * amd64-nbsd-tdep.c (amd64nbsd_init_abi): Likewise.
+       * amd64-obsd-tdep.c (amd64obsd_init_abi): Likewise.
+       * amd64-sol2-tdep.c (amd64_sol2_init_abi): Likewise.
+       * amd64-fbsd-nat.c (amd64_fbsd_nat_target): Likewise.
+
 2018-06-29  Pedro Alves  <palves@redhat.com>
 
        * gdb/amd64-tdep.h (amd64_create_target_description): Add
index fe8bfab721eab15fe8aabb69dbe9c83e51d17d02..24d21b9f4a1230a5d4b8990cce24f9ace55aa3f0 100644 (file)
@@ -100,7 +100,7 @@ x86_darwin_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch)
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
 
   tdep->struct_return = reg_struct_return;
 
index 85861ec86e5f632b218bd49e2497c9f6d0e6c2dc..a9af7a04612d0e36acccafe0658e3958af564855 100644 (file)
@@ -27,7 +27,7 @@ static void
 amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
 
   dicos_init_abi (gdbarch);
 }
index 6b0367b5d655ecc998d22775cea1944463bfea5b..f9b1bcae2e646d3d32944a99b351821514ffd875 100644 (file)
@@ -188,13 +188,13 @@ amd64_fbsd_nat_target::read_description ()
   if (x86bsd_xsave_len != 0)
     {
       if (is64)
-       return amd64_target_description (xcr0);
+       return amd64_target_description (xcr0, true);
       else
        return i386_target_description (xcr0);
     }
 #endif
   if (is64)
-    return amd64_target_description (X86_XSTATE_SSE_MASK);
+    return amd64_target_description (X86_XSTATE_SSE_MASK, true);
   else
     return i386_target_description (X86_XSTATE_SSE_MASK);
 }
index 9b2ee1365307a5915ab9bcd7d95cb4c9148057e4..f5bf1985b67e0f2ef88c5d3604c144e90572a4fa 100644 (file)
@@ -156,7 +156,7 @@ amd64fbsd_core_read_description (struct gdbarch *gdbarch,
                                 struct target_ops *target,
                                 bfd *abfd)
 {
-  return amd64_target_description (i386fbsd_core_read_xcr0 (abfd));
+  return amd64_target_description (i386fbsd_core_read_xcr0 (abfd), true);
 }
 
 /* Similar to amd64_supply_fpregset, but use XSAVE extended state.  */
@@ -218,7 +218,7 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->sizeof_gregset = 22 * 8;
 
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
 
   tdep->sigtramp_p = amd64fbsd_sigtramp_p;
   tdep->sigtramp_start = amd64fbsd_sigtramp_start_addr;
index f740bb4a82ae529a80e3e3dbb24716cffff345ec..d100beacd1906907a657ad061ce1ad1d6a684370 100644 (file)
@@ -105,7 +105,7 @@ amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->sizeof_gregset = 26 * 8;
 
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
 
   tdep->jb_pc_offset = 7 * 8;
 
index 1e078b14f8b2f3d81c2b6d34762c7fb2680792c6..da4739c9729045f2b9a272f60145a5f22953cca0 100644 (file)
@@ -421,7 +421,7 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
   obsd_init_abi (info, gdbarch);
 
   /* Initialize general-purpose register set details.  */
index 78d3d361cb46bf048a5f253e13ff78ea91d1f987..9504f190d72410ddb54922377b147b2c2b99ea38 100644 (file)
@@ -101,7 +101,7 @@ amd64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->sizeof_gregset = 28 * 8;
 
   amd64_init_abi (info, gdbarch,
-                 amd64_target_description (X86_XSTATE_SSE_MASK));
+                 amd64_target_description (X86_XSTATE_SSE_MASK, true));
 
   tdep->sigtramp_p = amd64_sol2_sigtramp_p;
   tdep->sigcontext_addr = amd64_sol2_mcontext_addr;