Use i386_target_description to get tdesc_i386
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)
GDB can call function i386_target_description to get the right target
description rather than tdesc_i386

gdb:

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

* amd64-fbsd-nat.c (amd64fbsd_read_description): Call
i386_target_description.
* i386-fbsd-nat.c (i386fbsd_read_description): Call
i386_target_description.
* i386-tdep.c (i386_gdbarch_init): Likewise.

gdb/ChangeLog
gdb/amd64-fbsd-nat.c
gdb/i386-fbsd-nat.c
gdb/i386-tdep.c

index af4284d2f90054d9b6ab2de5a8c6b5a5151b3744..8c31c8134feda311ccf23adfedab0a6a0680b62c 100644 (file)
@@ -1,3 +1,11 @@
+2017-09-04  Yao Qi  <yao.qi@linaro.org>
+
+       * amd64-fbsd-nat.c (amd64fbsd_read_description): Call
+       i386_target_description.
+       * i386-fbsd-nat.c (i386fbsd_read_description): Call
+       i386_target_description.
+       * i386-tdep.c (i386_gdbarch_init): Likewise.
+
 2017-09-04  Yao Qi  <yao.qi@linaro.org>
 
        * amd64-darwin-tdep.c: Include "x86-xstate.h".
index f3ddbdd3d9229b073ee57a101f618633b2edbde0..a22b82bb1b5ac38b19a9e2e435e4548954c123ba 100644 (file)
@@ -181,7 +181,7 @@ amd64fbsd_read_description (struct target_ops *ops)
   if (is64)
     return amd64_target_description (X86_XSTATE_SSE_MASK);
   else
-    return tdesc_i386;
+    return i386_target_description (X86_XSTATE_SSE_MASK);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
index dca6c0162b1a4eab8b1ef272946684c1d271d57f..ab671efe7a9d00ade7033f8a732d6b33672e8d96 100644 (file)
@@ -139,12 +139,10 @@ i386fbsd_read_description (struct target_ops *ops)
       xsave_probed = 1;
     }
 
-  if (x86bsd_xsave_len != 0)
-    {
-      return i386_target_description (xcr0);
-    }
-  else
-    return tdesc_i386;
+  if (x86bsd_xsave_len == 0)
+    xcr0 = X86_XSTATE_SSE_MASK;
+
+  return i386_target_description (xcr0);
 }
 #endif
 
index b1e5afd5537919b5edfac166d1d9eca0c6daa975..9d0dd3d5da56a28b61e46455d9d3339f6f7dbc5b 100644 (file)
@@ -8549,7 +8549,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Get the x86 target description from INFO.  */
   tdesc = info.target_desc;
   if (! tdesc_has_registers (tdesc))
-    tdesc = tdesc_i386;
+    tdesc = i386_target_description (X86_XSTATE_SSE_MASK);
   tdep->tdesc = tdesc;
 
   tdep->num_core_regs = I386_NUM_GREGS + I387_NUM_REGS;