From d7dcbefc724e59aa49e4ac2ac2337c8e1b8c367a Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Thu, 22 Jun 2017 15:33:18 +0100 Subject: [PATCH] Remove an instance of MAX_REGISTER_SIZE from record-full.c gdb/ * record-full.c (record_full_exec_insn): Use byte_vector. --- gdb/ChangeLog | 4 ++++ gdb/record-full.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e6809259981..1fad587c74b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-06-22 Alan Hayward + + * record-full.c (record_full_exec_insn): Use byte_vector. + 2017-06-22 Yao Qi * regformats/i386/amd64-avx-mpx-avx512-pku-linux.dat: Regenerated. diff --git a/gdb/record-full.c b/gdb/record-full.c index 31ff558d2a6..8e774a22711 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -36,6 +36,7 @@ #include "observer.h" #include "infrun.h" #include "common/gdb_unlinker.h" +#include "common/byte-vector.h" #include @@ -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; -- 2.30.2