+
+CORE_ADDR
+read_memory_typed_address (CORE_ADDR addr, struct type *type)
+{
+ gdb_byte *buf = alloca (TYPE_LENGTH (type));
+ read_memory (addr, buf, TYPE_LENGTH (type));
+ return extract_typed_address (buf, type);
+}
+
+/* Same as target_write_memory, but report an error if can't write. */
+void
+write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, int len)
+{
+ int status;
+ gdb_byte *bytes = alloca (len);
+
+ memcpy (bytes, myaddr, len);
+ status = target_write_memory (memaddr, bytes, len);
+ if (status != 0)
+ memory_error (status, memaddr);
+}
+
+/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
+void
+write_memory_unsigned_integer (CORE_ADDR addr, int len, ULONGEST value)
+{
+ gdb_byte *buf = alloca (len);
+ store_unsigned_integer (buf, len, value);
+ write_memory (addr, buf, len);
+}
+
+/* Store VALUE at ADDR in the inferior as a LEN-byte signed integer. */
+void
+write_memory_signed_integer (CORE_ADDR addr, int len, LONGEST value)
+{
+ gdb_byte *buf = alloca (len);
+ store_signed_integer (buf, len, value);
+ write_memory (addr, buf, len);
+}
+