summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-08-18 17:43:28 +0100
committerYao Qi <yao.qi@linaro.org>2017-08-21 11:16:07 +0100
commit2a9fdd0e5d2a6c123bacb9077d94d565f06eba67 (patch)
tree215cb12d738013c171a30a008644c4a2063dc39a
parent31d58a7437e87b4f9d3132918017746385e72831 (diff)
downloadbinutils-gdb-2a9fdd0e5d2a6c123bacb9077d94d565f06eba67.tar.gz
Use i386_target_description to get tdesc_i386
GDB can call function i386_target_description to get the right target description rather than tdesc_i386 gdb: 2017-08-18 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.
-rw-r--r--gdb/amd64-fbsd-nat.c2
-rw-r--r--gdb/i386-fbsd-nat.c10
-rw-r--r--gdb/i386-tdep.c2
3 files changed, 6 insertions, 8 deletions
diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c
index f3ddbdd3d92..a22b82bb1b5 100644
--- a/gdb/amd64-fbsd-nat.c
+++ b/gdb/amd64-fbsd-nat.c
@@ -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. */
diff --git a/gdb/i386-fbsd-nat.c b/gdb/i386-fbsd-nat.c
index dca6c0162b1..ab671efe7a9 100644
--- a/gdb/i386-fbsd-nat.c
+++ b/gdb/i386-fbsd-nat.c
@@ -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
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index b1e5afd5537..9d0dd3d5da5 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -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;