summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/regcache.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
committerDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
commit5c896fb3370431afa9c7d98a82fae8178865a1c7 (patch)
treef467007fe8e95dbd9187789b850d87128d864ae4 /gdb/gdbserver/regcache.c
parent011395def22c679506b483de9aa8f68e02178fb7 (diff)
downloadgdb-5c896fb3370431afa9c7d98a82fae8178865a1c7.tar.gz
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro. (xmalloc,xcalloc,xstrdup): Declare. * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup. * inferiors.c: Ditto. * linux-low.c: Ditto. * mem-break.c: Ditto. * regcache.c: Ditto. * remote-utils.c: Ditto. * server.c: Ditto. * target.c: Ditto. * win32-low.c: Ditto.
Diffstat (limited to 'gdb/gdbserver/regcache.c')
-rw-r--r--gdb/gdbserver/regcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index b5ec2159fc2..66022dd6a63 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -94,12 +94,12 @@ new_register_cache (void)
if (register_bytes == 0)
return NULL; /* The architecture hasn't been initialized yet. */
- regcache = malloc (sizeof (*regcache));
+ regcache = xmalloc (sizeof (*regcache));
/* 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);
+ regcache->registers = xcalloc (1, register_bytes);
if (regcache->registers == NULL)
fatal ("Could not allocate register cache.");