#include "target.h"
#include "value.h"
#include "gdbarch.h"
+#include "gdbsupport/traits.h"
struct trad_frame_cache
{
trad_frame_saved_reg *
trad_frame_alloc_saved_regs (struct gdbarch *gdbarch)
{
- gdb_static_assert (std::is_trivially_default_constructible<trad_frame_saved_reg>::value);
+#ifdef HAVE_IS_TRIVIALLY_CONSTRUCTIBLE
+ gdb_static_assert (std::is_trivially_constructible<trad_frame_saved_reg>::value);
+#endif
int numregs = gdbarch_num_cooked_regs (gdbarch);
trad_frame_saved_reg *this_saved_regs
void
trad_frame_set_value_bytes (trad_frame_saved_reg this_saved_regs[],
- int regnum, const gdb_byte *bytes,
- size_t size)
+ int regnum,
+ gdb::array_view<const gdb_byte> bytes)
{
/* Allocate the space and copy the data bytes. */
- gdb_byte *data = FRAME_OBSTACK_CALLOC (size, gdb_byte);
- memcpy (data, bytes, size);
+ gdb_byte *data = FRAME_OBSTACK_CALLOC (bytes.size (), gdb_byte);
+ memcpy (data, bytes.data (), bytes.size ());
this_saved_regs[regnum].set_value_bytes (data);
}
void
trad_frame_set_reg_value_bytes (struct trad_frame_cache *this_trad_cache,
- int regnum, const gdb_byte *bytes,
- size_t size)
+ int regnum,
+ gdb::array_view<const gdb_byte> bytes)
{
/* External interface for users of trad_frame_cache
(who cannot access the prev_regs object directly). */
- trad_frame_set_value_bytes (this_trad_cache->prev_regs, regnum, bytes,
- size);
+ trad_frame_set_value_bytes (this_trad_cache->prev_regs, regnum, bytes);
}