Introduce gdb::byte_vector, add allocator that default-initializes
[deliverable/binutils-gdb.git] / gdb / mi / mi-main.c
index 755fbabafb692819abcd62f9783e7e31c755e899..53289bb7e975a2be796bb05ed664542a75d2c822 100644 (file)
@@ -55,6 +55,7 @@
 #include "gdbcmd.h"
 #include "observer.h"
 #include "common/gdb_optional.h"
+#include "common/byte-vector.h"
 
 #include <ctype.h>
 #include "run-time-clock.h"
@@ -1466,12 +1467,12 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
   /* Create a buffer and read it in.  */
   total_bytes = word_size * nr_rows * nr_cols;
 
-  std::unique_ptr<gdb_byte[]> mbuf (new gdb_byte[total_bytes]);
+  gdb::byte_vector mbuf (total_bytes);
 
   /* Dispatch memory reads to the topmost target, not the flattened
      current_target.  */
   nr_bytes = target_read (current_target.beneath,
-                         TARGET_OBJECT_MEMORY, NULL, mbuf.get (),
+                         TARGET_OBJECT_MEMORY, NULL, mbuf.data (),
                          addr, total_bytes);
   if (nr_bytes <= 0)
     error (_("Unable to read memory."));
This page took 0.025065 seconds and 4 git commands to generate.