* regcache.c (new_register_cache): Clear the allocated register

buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
This commit is contained in:
Daniel Jacobowitz 2004-01-30 15:08:57 +00:00
parent ebac27b4c3
commit 2a68b70e96
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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 *

View File

@ -1,5 +1,5 @@
/* 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.
@ -101,7 +101,10 @@ new_register_cache (void)
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.");