aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 8cb9050..79d91d6 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8224,16 +8224,15 @@ Packet: '%s'\n"),
Packet: '%s'\n"),
hex_string (pnum), p, buf);
+ int reg_size = register_size (event->arch, reg->regnum);
cached_reg.num = reg->regnum;
- cached_reg.data.reset ((gdb_byte *)
- xmalloc (register_size (event->arch,
- reg->regnum)));
+ cached_reg.data.resize (reg_size);
p = p1 + 1;
- fieldsize = hex2bin (p, cached_reg.data.get (),
- register_size (event->arch, reg->regnum));
+ fieldsize = hex2bin (p, cached_reg.data.data (),
+ cached_reg.data.size ());
p += 2 * fieldsize;
- if (fieldsize < register_size (event->arch, reg->regnum))
+ if (fieldsize < reg_size)
warning (_("Remote reply is too short: %s"), buf);
event->regcache.push_back (std::move (cached_reg));
@@ -8572,7 +8571,7 @@ remote_target::process_stop_reply (stop_reply_up stop_reply,
for (cached_reg_t &reg : stop_reply->regcache)
{
- regcache->raw_supply (reg.num, reg.data.get ());
+ regcache->raw_supply (reg.num, reg.data);
rs->last_seen_expedited_registers.insert (reg.num);
}
}