This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use i386_target_description to get tdesc_i386
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 4 Sep 2017 10:35:07 -0000
- Subject: [binutils-gdb] Use i386_target_description to get tdesc_i386
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca1fa5eef2912262a0a33875e9a23f2e79a72328
commit ca1fa5eef2912262a0a33875e9a23f2e79a72328
Author: Yao Qi <yao.qi@linaro.org>
Date: Mon Sep 4 11:33:56 2017 +0100
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-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.
Diff:
---
gdb/ChangeLog | 8 ++++++++
gdb/amd64-fbsd-nat.c | 2 +-
gdb/i386-fbsd-nat.c | 10 ++++------
gdb/i386-tdep.c | 2 +-
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index af4284d..8c31c81 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
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".
(x86_darwin_init_abi_64): Call amd64_target_description.
* amd64-dicos-tdep.c: Likewise.
diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c
index f3ddbdd..a22b82b 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 dca6c01..ab671ef 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 b1e5afd..9d0dd3d 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;