gdb: make put_frame_register take an array_view

Change put_frame_register to take an array_view instead of a raw
pointer.

Add an assertion to verify that the number of bytes we try to write
matches the length of the register.

Change-Id: Ib75a9c8a12b47e203097621643eaa2c1830591ae
Reviewed-By: John Baldwin <jhb@FreeBSD.org>
This commit is contained in:
Simon Marchi
2023-12-01 11:27:20 -05:00
parent e94d1f726f
commit f6e3d5577d
9 changed files with 35 additions and 24 deletions

View File

@@ -731,7 +731,7 @@ extern bool read_frame_register_unsigned (frame_info_ptr frame,
frame. Note: this call makes the frame's state undefined. The
register and frame caches must be flushed. */
extern void put_frame_register (frame_info_ptr frame, int regnum,
const gdb_byte *buf);
gdb::array_view<const gdb_byte> buf);
/* Read LEN bytes from one or multiple registers starting with REGNUM
in frame FRAME, starting at OFFSET, into BUF. If the register