+
+#endif
+
+void
+collect_register (struct regcache *regcache, int n, void *buf)
+{
+ memcpy (buf, register_data (regcache, n, 1),
+ register_size (regcache->tdesc, n));
+}
+
+enum register_status
+regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
+ ULONGEST *val)
+{
+ int size;
+
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->tdesc->num_registers);
+
+ size = register_size (regcache->tdesc, regnum);
+
+ if (size > (int) sizeof (ULONGEST))
+ error (_("That operation is not available on integers of more than"
+ "%d bytes."),
+ (int) sizeof (ULONGEST));
+
+ *val = 0;
+ collect_register (regcache, regnum, val);
+
+ return REG_VALID;
+}
+
+#ifndef IN_PROCESS_AGENT
+
+void
+collect_register_as_string (struct regcache *regcache, int n, char *buf)
+{
+ bin2hex (register_data (regcache, n, 1), buf,
+ register_size (regcache->tdesc, n));
+}
+
+void
+collect_register_by_name (struct regcache *regcache,
+ const char *name, void *buf)
+{
+ collect_register (regcache, find_regno (regcache->tdesc, name), buf);
+}
+
+/* Special handling for register PC. */
+
+CORE_ADDR
+regcache_read_pc (struct regcache *regcache)
+{
+ CORE_ADDR pc_val;
+
+ if (the_target->read_pc)
+ pc_val = the_target->read_pc (regcache);
+ else
+ internal_error (__FILE__, __LINE__,
+ "regcache_read_pc: Unable to find PC");
+
+ return pc_val;
+}
+
+void
+regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
+{
+ if (the_target->write_pc)
+ the_target->write_pc (regcache, pc);
+ else
+ internal_error (__FILE__, __LINE__,
+ "regcache_write_pc: Unable to update PC");
+}
+
+#endif