+2004-01-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * regcache.c (new_register_cache): Clear the allocated register
+ buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
+
2003-10-13 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_resume): Take a struct thread_resume *
/* Register support routines for the remote server for GDB.
- Copyright 2001, 2002
+ Copyright 2001, 2002, 2004
Free Software Foundation, Inc.
This file is part of GDB.
regcache = malloc (sizeof (*regcache));
- regcache->registers = malloc (register_bytes);
+ /* Make sure to zero-initialize the register cache when it is created,
+ in case there are registers the target never fetches. This way they'll
+ read as zero instead of garbage. */
+ regcache->registers = calloc (1, register_bytes);
if (regcache->registers == NULL)
fatal ("Could not allocate register cache.");