@@ -79,7 +79,8 @@ struct reg_buffer_common
/* Compare the contents of the register stored in the regcache (ignoring the
first OFFSET bytes) to the contents of BUF (without any offset). Returns
true if the same. */
- virtual bool raw_compare (int regnum, const void *buf, int offset) const = 0;
+ virtual bool raw_compare (int regnum, const void *buf,
+ unsigned int offset) const = 0;
};
#endif /* COMMON_REGCACHE_H */
@@ -506,7 +506,7 @@ regcache::get_register_status (int regnum) const
/* See common/common-regcache.h. */
bool
-regcache::raw_compare (int regnum, const void *buf, int offset) const
+regcache::raw_compare (int regnum, const void *buf, unsigned int offset) const
{
gdb_assert (buf != NULL);
@@ -56,7 +56,8 @@ struct regcache : public reg_buffer_common
void raw_collect (int regnum, void *buf) const override;
/* See common/common-regcache.h. */
- bool raw_compare (int regnum, const void *buf, int offset) const override;
+ bool raw_compare (int regnum, const void *buf,
+ unsigned int offset) const override;
};
struct regcache *init_register_cache (struct regcache *regcache,
@@ -779,15 +779,14 @@ regcache::cooked_write (int regnum, const gdb_byte *buf)
operation. */
enum register_status
-readable_regcache::read_part (int regnum, int offset, int len, void *in,
- bool is_raw)
+readable_regcache::read_part (int regnum, unsigned int offset, unsigned int len,
+ void *in, bool is_raw)
{
struct gdbarch *gdbarch = arch ();
gdb_byte *reg = (gdb_byte *) alloca (register_size (gdbarch, regnum));
gdb_assert (in != NULL);
- gdb_assert (offset >= 0 && offset <= m_descr->sizeof_register[regnum]);
- gdb_assert (len >= 0 && offset + len <= m_descr->sizeof_register[regnum]);
+ gdb_assert (offset + len <= m_descr->sizeof_register[regnum]);
/* Something to do? */
if (offset + len == 0)
return REG_VALID;
@@ -808,15 +807,14 @@ readable_regcache::read_part (int regnum, int offset, int len, void *in,
}
enum register_status
-regcache::write_part (int regnum, int offset, int len,
- const void *out, bool is_raw)
+regcache::write_part (int regnum, unsigned int offset, unsigned int len,
+ const void *out, bool is_raw)
{
struct gdbarch *gdbarch = arch ();
gdb_byte *reg = (gdb_byte *) alloca (register_size (gdbarch, regnum));
gdb_assert (out != NULL);
- gdb_assert (offset >= 0 && offset <= m_descr->sizeof_register[regnum]);
- gdb_assert (len >= 0 && offset + len <= m_descr->sizeof_register[regnum]);
+ gdb_assert (offset + len <= m_descr->sizeof_register[regnum]);
/* Something to do? */
if (offset + len == 0)
return REG_VALID;
@@ -845,7 +843,8 @@ regcache::write_part (int regnum, int offset, int len,
}
enum register_status
-readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf)
+readable_regcache::raw_read_part (int regnum, unsigned int offset,
+ unsigned int len, gdb_byte *buf)
{
assert_regnum (regnum);
return read_part (regnum, offset, len, buf, true);
@@ -854,7 +853,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf
/* See regcache.h. */
void
-regcache::raw_write_part (int regnum, int offset, int len,
+regcache::raw_write_part (int regnum, unsigned int offset, unsigned int len,
const gdb_byte *buf)
{
assert_regnum (regnum);
@@ -862,15 +861,15 @@ regcache::raw_write_part (int regnum, int offset, int len,
}
enum register_status
-readable_regcache::cooked_read_part (int regnum, int offset, int len,
- gdb_byte *buf)
+readable_regcache::cooked_read_part (int regnum, unsigned int offset,
+ unsigned int len, gdb_byte *buf)
{
gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
return read_part (regnum, offset, len, buf, false);
}
void
-regcache::cooked_write_part (int regnum, int offset, int len,
+regcache::cooked_write_part (int regnum, unsigned int offset, unsigned int len,
const gdb_byte *buf)
{
gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
@@ -1077,7 +1076,7 @@ regcache::collect_regset (const struct regset *regset,
/* See common/common-regcache.h. */
bool
-reg_buffer::raw_compare (int regnum, const void *buf, int offset) const
+reg_buffer::raw_compare (int regnum, const void *buf, unsigned int offset) const
{
gdb_assert (buf != NULL);
assert_regnum (regnum);
@@ -188,7 +188,8 @@ public:
virtual ~reg_buffer () = default;
/* See common/common-regcache.h. */
- bool raw_compare (int regnum, const void *buf, int offset) const override;
+ bool raw_compare (int regnum, const void *buf,
+ unsigned int offset) const override;
protected:
/* Assert on the range of REGNUM. */
@@ -232,8 +233,8 @@ public:
enum register_status raw_read (int regnum, T *val);
/* Partial transfer of raw registers. Return the status of the register. */
- enum register_status raw_read_part (int regnum, int offset, int len,
- gdb_byte *buf);
+ enum register_status raw_read_part (int regnum, unsigned int offset,
+ unsigned int len, gdb_byte *buf);
/* Make certain that the register REGNUM is up-to-date. */
virtual void raw_update (int regnum) = 0;
@@ -245,16 +246,16 @@ public:
enum register_status cooked_read (int regnum, T *val);
/* Partial transfer of a cooked register. */
- enum register_status cooked_read_part (int regnum, int offset, int len,
- gdb_byte *buf);
+ enum register_status cooked_read_part (int regnum, unsigned int offset,
+ unsigned int len, gdb_byte *buf);
/* Read register REGNUM from the regcache and return a new value. This
will call mark_value_bytes_unavailable as appropriate. */
struct value *cooked_read_value (int regnum);
protected:
- enum register_status read_part (int regnum, int offset, int len, void *in,
- bool is_raw);
+ enum register_status read_part (int regnum, unsigned int offset,
+ unsigned int len, void *in, bool is_raw);
};
/* Buffer of registers, can be read and written. */
@@ -311,11 +312,12 @@ public:
/* Partial transfer of raw registers. Perform read, modify, write style
operations. */
- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
+ void raw_write_part (int regnum, unsigned int offset, unsigned int len,
+ const gdb_byte *buf);
/* Partial transfer of a cooked register. Perform read, modify, write style
operations. */
- void cooked_write_part (int regnum, int offset, int len,
+ void cooked_write_part (int regnum, unsigned int offset, unsigned int len,
const gdb_byte *buf);
void supply_regset (const struct regset *regset,
@@ -355,8 +357,9 @@ private:
int regnum, const void *in_buf,
void *out_buf, size_t size) const;
- enum register_status write_part (int regnum, int offset, int len,
- const void *out, bool is_raw);
+ enum register_status write_part (int regnum, unsigned int offset,
+ unsigned int len, const void *out,
+ bool is_raw);
/* The address space of this register cache (for registers where it