aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-08-15 11:23:13 -0600
committerTom Tromey <tromey@adacore.com>2019-08-15 11:24:22 -0600
commitd59b55f0952e95fdbec58021cecce85f4557b485 (patch)
treeacbe5f6b118b2acb23844e556fea2a7b883e16e4 /gdb
parent97dd8e07d998f5f0fcd0d06fd53e2ae9d337d222 (diff)
downloadgdb-d59b55f0952e95fdbec58021cecce85f4557b485.zip
gdb-d59b55f0952e95fdbec58021cecce85f4557b485.tar.gz
gdb-d59b55f0952e95fdbec58021cecce85f4557b485.tar.bz2
Use gdb::byte_vector in target_write_memory
Pedro pointed out that target_write_memory should use gdb::byte_vector rather than std::vector<unsigned char>. gdb/gdbserver/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * target.c (target_write_memory): Use gdb::byte_vector.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/target.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f536686..adac3e8 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,9 @@
2019-08-15 Tom Tromey <tromey@adacore.com>
+ * target.c (target_write_memory): Use gdb::byte_vector.
+
+2019-08-15 Tom Tromey <tromey@adacore.com>
+
* tracepoint.c (write_inferior_data_pointer)
(write_inferior_integer, write_inferior_int8)
(write_inferior_uinteger, m_tracepoint_action_download)
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 6f6b448..0b45b6c 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -20,6 +20,7 @@
#include "server.h"
#include "tracepoint.h"
+#include "gdbsupport/byte-vector.h"
struct target_ops *the_target;
@@ -154,7 +155,7 @@ target_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
{
/* Make a copy of the data because check_mem_write may need to
update it. */
- std::vector<unsigned char> buffer (myaddr, myaddr + len);
+ gdb::byte_vector buffer (myaddr, myaddr + len);
check_mem_write (memaddr, buffer.data (), myaddr, len);
return (*the_target->write_memory) (memaddr, buffer.data (), len);
}