Use gdb::byte_vector in target_write_memory
authorTom Tromey <tromey@adacore.com>
Thu, 15 Aug 2019 17:23:13 +0000 (11:23 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 15 Aug 2019 17:24:22 +0000 (11:24 -0600)
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.

gdb/gdbserver/ChangeLog
gdb/gdbserver/target.c

index f536686..adac3e8 100644 (file)
@@ -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)
index 6f6b448..0b45b6c 100644 (file)
@@ -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);
 }