2010-02-03 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Feb 2010 18:20:21 +0000 (18:20 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Feb 2010 18:20:21 +0000 (18:20 +0000)
* regcache.c (supply_register): Clear regcache if buf is NULL.

gdb/gdbserver/ChangeLog
gdb/gdbserver/regcache.c

index 08277daf346672c790014738cb91f094d0daf9cb..ac6af76a736ca6c38ee86b8f809ca099c734494e 100644 (file)
@@ -1,5 +1,9 @@
+2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * regcache.c (supply_register): Clear regcache if buf is NULL.
+
 2010-02-02  Nicolas Roche  <roche@sourceware.org>
-            Joel Brobecker  <brobecker@adacore.com>
+           Joel Brobecker  <brobecker@adacore.com>
 
        * inferiors.c (find_inferior): Add function documentation.
        (unloaded_dll): Handle the case where the unloaded dll has not
index 20826043ee986dc69d2b399024bb7f059ce8437d..d6cdc46d42a5a0152b79fd80b50c336829a4c2d6 100644 (file)
@@ -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
This page took 0.028426 seconds and 4 git commands to generate.