public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* PATCH: gdbserver: Clear regcache if buf is NULL
@ 2010-02-03 17:44 H.J. Lu
  2010-02-03 17:57 ` Daniel Jacobowitz
  2010-09-29  1:54 ` Pedro Alves
  0 siblings, 2 replies; 10+ messages in thread
From: H.J. Lu @ 2010-02-03 17:44 UTC (permalink / raw)
  To: GDB

If xstate_bv bits are zero, XSAVE extended state is in init state and
gdbserver should treat XMM/YMM registers as 0. This patch clears regcache
if buf is NULL. OK to install?

Thanks.


H.J.
---
2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>

	* regcache.c (supply_register): Clear regcache if buf is NULL.

diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index 2082604..d6cdc46 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -215,7 +215,10 @@ register_data (struct regcache *regcache, int n, int fetch)
 void
 supply_register (struct regcache *regcache, int n, const void *buf)
 {
-  memcpy (register_data (regcache, n, 0), buf, register_size (n));
+  if (buf)
+    memcpy (register_data (regcache, n, 0), buf, register_size (n));
+  else
+    memset (register_data (regcache, n, 0), 0, register_size (n));
 }
 
 void

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-10-31 13:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03 17:44 PATCH: gdbserver: Clear regcache if buf is NULL H.J. Lu
2010-02-03 17:57 ` Daniel Jacobowitz
2010-09-29  1:54 ` Pedro Alves
2010-10-01  1:51   ` H.J. Lu
2010-10-16 20:01     ` Pedro Alves
2010-10-16 20:16       ` H.J. Lu
2010-10-16 20:49         ` Pedro Alves
2010-10-16 22:02           ` H.J. Lu
2010-10-17  8:01             ` Pedro Alves
2010-10-31 13:25           ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).