aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdbserver/linux-x86-low.cc27
1 files changed, 16 insertions, 11 deletions
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index 6de44ae..e8ef366 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -869,6 +869,22 @@ x86_linux_read_description (void)
#endif
}
+ /* If we are not allowed to send an XML target description then we need
+ to use the hard-wired target descriptions. This corresponds to GDB's
+ default machine for x86.
+
+ This check needs to occur before any returns statements that might
+ generate some alternative target descriptions. */
+ if (!use_xml)
+ {
+#ifdef __x86_64__
+ if (machine == EM_X86_64)
+ return tdesc_amd64_linux_no_xml.get ();
+ else
+#endif
+ return tdesc_i386_linux_no_xml.get ();
+ }
+
#if !defined __x86_64__ && defined HAVE_PTRACE_GETFPXREGS
if (machine == EM_386 && have_ptrace_getfpxregs == -1)
{
@@ -885,17 +901,6 @@ x86_linux_read_description (void)
}
#endif
- if (!use_xml)
- {
- /* Don't use XML. */
-#ifdef __x86_64__
- if (machine == EM_X86_64)
- return tdesc_amd64_linux_no_xml.get ();
- else
-#endif
- return tdesc_i386_linux_no_xml.get ();
- }
-
if (have_ptrace_getregset == TRIBOOL_UNKNOWN)
{
uint64_t xstateregs[(X86_XSTATE_SSE_SIZE / sizeof (uint64_t))];