Use amd64_target_description to get tdesc_amd64
authorYao Qi <yao.qi@linaro.org>
Mon, 4 Sep 2017 10:33:56 +0000 (11:33 +0100)
committerYao Qi <yao.qi@linaro.org>
Mon, 4 Sep 2017 10:33:56 +0000 (11:33 +0100)
This patch changes amd64-*-tdep.c files to use function
amd64_target_description to get the right target description rather than
use the variable tdesd_amd64.

gdb:

2017-09-04  Yao Qi  <yao.qi@linaro.org>

* amd64-darwin-tdep.c: Include "x86-xstate.h".
(x86_darwin_init_abi_64): Call amd64_target_description.
* amd64-dicos-tdep.c: Likewise.
* amd64-fbsd-nat.c: Likewise.
* amd64-fbsd-tdep.c: Likewise.
* amd64-nbsd-tdep.c: Likewise.
* amd64-obsd-tdep.c: Likewise.
* amd64-sol2-tdep.c: Likewise.
* amd64-windows-tdep.c: Likewise.
* amd64-tdep.h (tdesc_amd64): Remove the declaration.

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
gdb/amd64-tdep.h
gdb/amd64-windows-tdep.c

index 09d38e3ae1dfe29773840158da5389d79485f7ed..af4284d2f90054d9b6ab2de5a8c6b5a5151b3744 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-04  Yao Qi  <yao.qi@linaro.org>
+
+       * amd64-darwin-tdep.c: Include "x86-xstate.h".
+       (x86_darwin_init_abi_64): Call amd64_target_description.
+       * amd64-dicos-tdep.c: Likewise.
+       * amd64-fbsd-nat.c: Likewise.
+       * amd64-fbsd-tdep.c: Likewise.
+       * amd64-nbsd-tdep.c: Likewise.
+       * amd64-obsd-tdep.c: Likewise.
+       * amd64-sol2-tdep.c: Likewise.
+       * amd64-windows-tdep.c: Likewise.
+       * amd64-tdep.h (tdesc_amd64): Remove the declaration.
+
 2017-09-04  Simon Marchi  <simon.marchi@ericsson.com>
 
        * btrace.h (btrace_insn_s, DEF_VEC_O (btrace_insn_s)): Remove.
index be26d9e3c4bbfc5cec398286bc5b081c9ec887e7..81dba82102a320006c462d68ac1cd3d0a514fba8 100644 (file)
@@ -29,6 +29,7 @@
 #include "objfiles.h"
 
 #include "i387-tdep.h"
+#include "x86-xstate.h"
 #include "amd64-tdep.h"
 #include "osabi.h"
 #include "ui-out.h"
@@ -99,7 +100,8 @@ x86_darwin_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   tdep->struct_return = reg_struct_return;
 
index 7bdb167e82d93b727d1e96e321c437767edeffd8..d319dd928f2bc4d88cdb674d6fd03e0cfd74ae06 100644 (file)
 #include "defs.h"
 #include "osabi.h"
 #include "amd64-tdep.h"
+#include "x86-xstate.h"
 #include "dicos-tdep.h"
 
 static void
 amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   dicos_init_abi (gdbarch);
 }
index 1fe0d56b3a8dd453206a1f934b01507888691800..f3ddbdd3d9229b073ee57a101f618633b2edbde0 100644 (file)
@@ -179,7 +179,7 @@ amd64fbsd_read_description (struct target_ops *ops)
     }
 #endif
   if (is64)
-    return tdesc_amd64;
+    return amd64_target_description (X86_XSTATE_SSE_MASK);
   else
     return tdesc_i386;
 }
index ad4d787998db1219c9fe72f7fc37eb1f3ed42be2..897cab945f6aea660fb7d9204a88c17a010cb9d3 100644 (file)
@@ -217,7 +217,8 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->gregset_num_regs = ARRAY_SIZE (amd64fbsd_r_reg_offset);
   tdep->sizeof_gregset = 22 * 8;
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   tdep->sigtramp_p = amd64fbsd_sigtramp_p;
   tdep->sigtramp_start = amd64fbsd_sigtramp_start_addr;
index 02bf42776e10d7f87734175960126ca23097097b..9ae022729f6c000de0b75ae42212149463ba65d3 100644 (file)
@@ -25,6 +25,7 @@
 #include "symtab.h"
 
 #include "amd64-tdep.h"
+#include "x86-xstate.h"
 #include "nbsd-tdep.h"
 #include "solib-svr4.h"
 
@@ -103,7 +104,8 @@ amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->gregset_num_regs = ARRAY_SIZE (amd64nbsd_r_reg_offset);
   tdep->sizeof_gregset = 26 * 8;
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   tdep->jb_pc_offset = 7 * 8;
 
index ad90c20b5af2bc2a4a26288692ee11ccd056e7ec..54942cc71585fefb904667f2b162c7b1f1065870 100644 (file)
@@ -32,6 +32,7 @@
 #include "obsd-tdep.h"
 #include "amd64-tdep.h"
 #include "i387-tdep.h"
+#include "x86-xstate.h"
 #include "solib-svr4.h"
 #include "bsd-uthread.h"
 
@@ -419,7 +420,8 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
   obsd_init_abi (info, gdbarch);
 
   /* Initialize general-purpose register set details.  */
index ca474db8b2ecce1745c1fce995e434cb80bcc435..1ae2edc6333fe4c1a4ca3247bb998bcc18be595c 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "sol2-tdep.h"
 #include "amd64-tdep.h"
+#include "x86-xstate.h"
 #include "solib-svr4.h"
 
 /* Mapping between the general-purpose registers in gregset_t format
@@ -99,7 +100,8 @@ amd64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->gregset_num_regs = ARRAY_SIZE (amd64_sol2_gregset_reg_offset);
   tdep->sizeof_gregset = 28 * 8;
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   tdep->sigtramp_p = amd64_sol2_sigtramp_p;
   tdep->sigcontext_addr = amd64_sol2_mcontext_addr;
index 23fa5b843091444a9d8892364d1dc3cc12146582..047af3f0744bf4ad49b605347e6c09b6f8ccd84e 100644 (file)
@@ -87,8 +87,6 @@ enum amd64_regnum
 
 #define AMD64_NUM_REGS         (AMD64_GSBASE_REGNUM + 1)
 
-extern struct target_desc *tdesc_amd64;
-
 extern struct displaced_step_closure *amd64_displaced_step_copy_insn
   (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
    struct regcache *regs);
index 9158282cf9a4c25a282b08dfbda708574f5e78a3..5ac73bd8c97e51e63660500b75d9fe173b8a71eb 100644 (file)
@@ -18,6 +18,7 @@
 #include "defs.h"
 #include "osabi.h"
 #include "amd64-tdep.h"
+#include "x86-xstate.h"
 #include "gdbtypes.h"
 #include "gdbcore.h"
 #include "regcache.h"
@@ -1224,7 +1225,8 @@ amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   */
   frame_unwind_append_unwinder (gdbarch, &amd64_windows_frame_unwind);
 
-  amd64_init_abi (info, gdbarch, tdesc_amd64);
+  amd64_init_abi (info, gdbarch,
+                 amd64_target_description (X86_XSTATE_SSE_MASK));
 
   windows_init_abi (info, gdbarch);