forked from Imagelibrary/binutils-gdb
Rename read_string
This renames read_string to be an overload of target_read_string. This makes it more consistent for the eventual merger with gdbserver.
This commit is contained in:
@@ -352,8 +352,8 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
|||||||
if (*length > 0)
|
if (*length > 0)
|
||||||
fetchlimit = UINT_MAX;
|
fetchlimit = UINT_MAX;
|
||||||
|
|
||||||
err = read_string (addr, *length, width, fetchlimit,
|
err = target_read_string (addr, *length, width, fetchlimit,
|
||||||
byte_order, buffer, length);
|
byte_order, buffer, length);
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
memory_error (TARGET_XFER_E_IO, addr);
|
memory_error (TARGET_XFER_E_IO, addr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1406,8 +1406,8 @@ target_read_string (CORE_ADDR memaddr, int len, int *bytes_read)
|
|||||||
bytes_read = &ignore;
|
bytes_read = &ignore;
|
||||||
|
|
||||||
/* Note that the endian-ness does not matter here. */
|
/* Note that the endian-ness does not matter here. */
|
||||||
int errcode = read_string (memaddr, -1, 1, len, BFD_ENDIAN_LITTLE,
|
int errcode = target_read_string (memaddr, -1, 1, len, BFD_ENDIAN_LITTLE,
|
||||||
&buffer, bytes_read);
|
&buffer, bytes_read);
|
||||||
if (errcode != 0)
|
if (errcode != 0)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
|||||||
@@ -2050,9 +2050,11 @@ partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr,
|
|||||||
failure happened. Check BYTES_READ to recognize this situation. */
|
failure happened. Check BYTES_READ to recognize this situation. */
|
||||||
|
|
||||||
int
|
int
|
||||||
read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
|
target_read_string (CORE_ADDR addr, int len, int width,
|
||||||
enum bfd_endian byte_order, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
unsigned int fetchlimit,
|
||||||
int *bytes_read)
|
enum bfd_endian byte_order,
|
||||||
|
gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
||||||
|
int *bytes_read)
|
||||||
{
|
{
|
||||||
int errcode; /* Errno returned from bad reads. */
|
int errcode; /* Errno returned from bad reads. */
|
||||||
unsigned int nfetch; /* Chars to fetch / chars fetched. */
|
unsigned int nfetch; /* Chars to fetch / chars fetched. */
|
||||||
@@ -2731,8 +2733,8 @@ val_print_string (struct type *elttype, const char *encoding,
|
|||||||
fetchlimit = (len == -1 ? options->print_max : std::min ((unsigned) len,
|
fetchlimit = (len == -1 ? options->print_max : std::min ((unsigned) len,
|
||||||
options->print_max));
|
options->print_max));
|
||||||
|
|
||||||
err = read_string (addr, len, width, fetchlimit, byte_order,
|
err = target_read_string (addr, len, width, fetchlimit, byte_order,
|
||||||
&buffer, &bytes_read);
|
&buffer, &bytes_read);
|
||||||
|
|
||||||
addr += bytes_read;
|
addr += bytes_read;
|
||||||
|
|
||||||
|
|||||||
@@ -165,11 +165,11 @@ extern void print_function_pointer_address (const struct value_print_options *op
|
|||||||
CORE_ADDR address,
|
CORE_ADDR address,
|
||||||
struct ui_file *stream);
|
struct ui_file *stream);
|
||||||
|
|
||||||
extern int read_string (CORE_ADDR addr, int len, int width,
|
extern int target_read_string (CORE_ADDR addr, int len, int width,
|
||||||
unsigned int fetchlimit,
|
unsigned int fetchlimit,
|
||||||
enum bfd_endian byte_order,
|
enum bfd_endian byte_order,
|
||||||
gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
||||||
int *bytes_read);
|
int *bytes_read);
|
||||||
|
|
||||||
/* Helper function to check the validity of some bits of a value.
|
/* Helper function to check the validity of some bits of a value.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user