It helped me during development, catching bugs closer to when they actually
happened.
Also remove the equivalent gdb_assert in regcache_raw_read_unsigned, since
it's checking the same condition a few frames above.
Suggested-By: Simon Marchi <simon.marchi@efficios.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
static const struct gdb::reg &
find_register_by_number (const struct target_desc *tdesc, int n)
{
+ gdb_assert (n >= 0);
+ gdb_assert (n < tdesc->reg_defs.size ());
+
return tdesc->reg_defs[n];
}
int size;
gdb_assert (regcache != NULL);
- gdb_assert (regnum >= 0
- && regnum < regcache->tdesc->reg_defs.size ());
size = register_size (regcache->tdesc, regnum);