- while (curaddr >= lorange && curaddr < hirange)
- {
- read_memory (curaddr, data_found, len);
- for (i = 0; i < len; ++i)
- if ((data_found[i] & mask[i]) != data[i])
- goto try_again;
- /* It matches. */
- *addr_found = curaddr;
- return;
-
- try_again:
- curaddr += increment;
- }
- *addr_found = (CORE_ADDR)0;
- return;
+ status = target_write_memory (memaddr, myaddr, 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,
+ enum bfd_endian byte_order,
+ ULONGEST value)
+{
+ gdb_byte *buf = alloca (len);
+
+ store_unsigned_integer (buf, len, byte_order, 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,
+ enum bfd_endian byte_order,
+ LONGEST value)
+{
+ gdb_byte *buf = alloca (len);
+
+ store_signed_integer (buf, len, byte_order, value);
+ write_memory (addr, buf, len);