diff options
Diffstat (limited to 'gdb/gdbserver/regcache.c')
-rw-r--r-- | gdb/gdbserver/regcache.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 |