]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename read_string
authorTom Tromey <tromey@adacore.com>
Wed, 13 Apr 2022 12:25:07 +0000 (06:25 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 14 Apr 2022 18:12:34 +0000 (12:12 -0600)
This renames read_string to be an overload of target_read_string.
This makes it more consistent for the eventual merger with gdbserver.

gdb/c-lang.c
gdb/target.c
gdb/valprint.c
gdb/valprint.h

index 014dbefb8e2029ce89aa09e2211dec1f7912b9df..a7ecf8f91da3e15ae7b23a873645df682f20eae9 100644 (file)
@@ -352,8 +352,8 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
       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);
     }
index f33bf345cfa97ede2ac43ba0e895d8f7a4204ca4..6542305f0d05a7de1f7ff4359ea20b762b592818 100644 (file)
@@ -1406,8 +1406,8 @@ target_read_string (CORE_ADDR memaddr, int len, int *bytes_read)
     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 {};
 
index 65b85cfb0384acc9bbd1a7d1a2aa383761782ad7..a4c0f7b343d9663858c4fcb7d15657c6ee165ffc 100644 (file)
@@ -2050,9 +2050,11 @@ partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr,
    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.  */
@@ -2731,8 +2733,8 @@ val_print_string (struct type *elttype, const char *encoding,
   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;
 
index 0586836f9e6d68c48f1ad198125f4d5dc7be0750..2f4a5022b3ee074f25e768c9574b459730022cf0 100644 (file)
@@ -165,11 +165,11 @@ extern void print_function_pointer_address (const struct value_print_options *op
                                            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.