Remove an instance of MAX_REGISTER_SIZE from record-full.c
authorAlan Hayward <alan.hayward@arm.com>
Thu, 22 Jun 2017 14:33:18 +0000 (15:33 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Thu, 22 Jun 2017 14:33:18 +0000 (15:33 +0100)
gdb/
* record-full.c (record_full_exec_insn): Use byte_vector.

gdb/ChangeLog
gdb/record-full.c

index e6809259981f886c14e93f264ac5eaebff63a69e..1fad587c74b0f84175f89ae6dda21c79ba76a3e5 100644 (file)
@@ -1,3 +1,7 @@
+2017-06-22  Alan Hayward  <alan.hayward@arm.com>
+
+       * record-full.c (record_full_exec_insn): Use byte_vector.
+
 2017-06-22  Yao Qi  <yao.qi@linaro.org>
 
        * regformats/i386/amd64-avx-mpx-avx512-pku-linux.dat: Regenerated.
index 31ff558d2a633cff71d3e6082e42f5d6fb88bcf1..8e774a22711adc3b7c4a77350955b2be628fcc1a 100644 (file)
@@ -36,6 +36,7 @@
 #include "observer.h"
 #include "infrun.h"
 #include "common/gdb_unlinker.h"
+#include "common/byte-vector.h"
 
 #include <signal.h>
 
@@ -698,7 +699,7 @@ record_full_exec_insn (struct regcache *regcache,
     {
     case record_full_reg: /* reg */
       {
-        gdb_byte reg[MAX_REGISTER_SIZE];
+       gdb::byte_vector reg (entry->u.reg.len);
 
         if (record_debug > 1)
           fprintf_unfiltered (gdb_stdlog,
@@ -707,10 +708,10 @@ record_full_exec_insn (struct regcache *regcache,
                               host_address_to_string (entry),
                               entry->u.reg.num);
 
-        regcache_cooked_read (regcache, entry->u.reg.num, reg);
+        regcache_cooked_read (regcache, entry->u.reg.num, reg.data ());
         regcache_cooked_write (regcache, entry->u.reg.num, 
                               record_full_get_loc (entry));
-        memcpy (record_full_get_loc (entry), reg, entry->u.reg.len);
+        memcpy (record_full_get_loc (entry), reg.data (), entry->u.reg.len);
       }
       break;