public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Rename read_string Date: Thu, 14 Apr 2022 18:21:26 +0000 (GMT) [thread overview] Message-ID: <20220414182126.2F8243858C53@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3b1bdd53b5a9f0798a9315fa9309d2979045aeaf commit 3b1bdd53b5a9f0798a9315fa9309d2979045aeaf Author: Tom Tromey <tromey@adacore.com> Date: Wed Apr 13 06:25:07 2022 -0600 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. Diff: --- gdb/c-lang.c | 4 ++-- gdb/target.c | 4 ++-- gdb/valprint.c | 12 +++++++----- gdb/valprint.h | 10 +++++----- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 014dbefb8e2..a7ecf8f91da 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -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); } diff --git a/gdb/target.c b/gdb/target.c index f33bf345cfa..6542305f0d0 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -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 {}; diff --git a/gdb/valprint.c b/gdb/valprint.c index 65b85cfb038..a4c0f7b343d 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -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; diff --git a/gdb/valprint.h b/gdb/valprint.h index 0586836f9e6..2f4a5022b3e 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -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.
reply other threads:[~2022-04-14 18:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220414182126.2F8243858C53@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).