This renames read_string to be an overload of target_read_string.
This makes it more consistent for the eventual merger with gdbserver.
if (*length > 0)
fetchlimit = UINT_MAX;
- err = read_string (addr, *length, width, fetchlimit,
- byte_order, buffer, length);
+ err = target_read_string (addr, *length, width, fetchlimit,
+ byte_order, buffer, length);
if (err != 0)
memory_error (TARGET_XFER_E_IO, addr);
}
bytes_read = &ignore;
/* Note that the endian-ness does not matter here. */
- int errcode = read_string (memaddr, -1, 1, len, BFD_ENDIAN_LITTLE,
- &buffer, bytes_read);
+ int errcode = target_read_string (memaddr, -1, 1, len, BFD_ENDIAN_LITTLE,
+ &buffer, bytes_read);
if (errcode != 0)
return {};
failure happened. Check BYTES_READ to recognize this situation. */
int
-read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
- enum bfd_endian byte_order, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
- int *bytes_read)
+target_read_string (CORE_ADDR addr, int len, int width,
+ unsigned int fetchlimit,
+ enum bfd_endian byte_order,
+ gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
+ int *bytes_read)
{
int errcode; /* Errno returned from bad reads. */
unsigned int nfetch; /* Chars to fetch / chars fetched. */
fetchlimit = (len == -1 ? options->print_max : std::min ((unsigned) len,
options->print_max));
- err = read_string (addr, len, width, fetchlimit, byte_order,
- &buffer, &bytes_read);
+ err = target_read_string (addr, len, width, fetchlimit, byte_order,
+ &buffer, &bytes_read);
addr += bytes_read;
CORE_ADDR address,
struct ui_file *stream);
-extern int read_string (CORE_ADDR addr, int len, int width,
- unsigned int fetchlimit,
- enum bfd_endian byte_order,
- gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
- int *bytes_read);
+extern int target_read_string (CORE_ADDR addr, int len, int width,
+ unsigned int fetchlimit,
+ enum bfd_endian byte_order,
+ gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
+ int *bytes_read);
/* Helper function to check the validity of some bits of a value.