- /* 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.");
+ 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 = xcalloc (1, register_bytes);