This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Always initialize x86_xcr0 to I386_XSTATE_SSE_MASK


Hi,

We should always initialize x86_xcr0 to I386_XSTATE_SSE_MASK when
calling init_registers_i386_linux/init_registers_amd64_linux.  Othewise,
we may run into problems when invalidating regcache.  OK to install?

Thanks.


H.J.
---
2010-04-11  H.J. Lu  <hongjiu.lu@intel.com>

	* linux-x86-low.c (x86_linux_update_xmltarget): Always initialize
	x86_xcr0 to I386_XSTATE_SSE_MASK.

diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index d79713f..15521a6 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -842,6 +842,9 @@ x86_linux_update_xmltarget (void)
     return;
 
   pid = pid_of (get_thread_lwp (current_inferior));
+
+  x86_xcr0 = I386_XSTATE_SSE_MASK;
+
 #ifdef __x86_64__
   if (num_xmm_registers == 8)
     init_registers_i386_linux ();
@@ -894,8 +897,6 @@ x86_linux_update_xmltarget (void)
       gdbserver_xmltarget = xmltarget_i386_linux_no_xml;
 #endif
 
-      x86_xcr0 = I386_XSTATE_SSE_MASK;
-
       return;
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]