diff options
author | Tom Tromey <tromey@adacore.com> | 2022-04-13 06:42:19 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-04-14 12:12:34 -0600 |
commit | b17c7ab3808f5b781537514b28695dafaa29cb28 (patch) | |
tree | 4d542aeb0071db24f24d08333ab99198ad4b0cf6 /gdb/target.c | |
parent | 9da74023eb9378315d6b7e1bae02f52cfecc8bd1 (diff) | |
download | gdb-b17c7ab3808f5b781537514b28695dafaa29cb28.zip gdb-b17c7ab3808f5b781537514b28695dafaa29cb28.tar.gz gdb-b17c7ab3808f5b781537514b28695dafaa29cb28.tar.bz2 |
Move target_read_string to target/target.c
This moves the two overloads of target_read_string to a new file,
target/target.c, and updates both gdb and gdbserver to build this.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/gdb/target.c b/gdb/target.c index 5a416d5..7d291fd 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1394,25 +1394,6 @@ target_xfer_status_to_string (enum target_xfer_status status) }; -/* See target.h. */ - -gdb::unique_xmalloc_ptr<char> -target_read_string (CORE_ADDR memaddr, int len, int *bytes_read) -{ - gdb::unique_xmalloc_ptr<gdb_byte> buffer; - - int ignore; - if (bytes_read == nullptr) - bytes_read = &ignore; - - /* Note that the endian-ness does not matter here. */ - int errcode = target_read_string (memaddr, -1, 1, len, &buffer, bytes_read); - if (errcode != 0) - return {}; - - return gdb::unique_xmalloc_ptr<char> ((char *) buffer.release ()); -} - const target_section_table * target_get_section_table (struct target_ops *target) { |