Remove MAX_REGISTER_SIZE from mi/mi-main.c
gdb/ * mi/mi-main.c (register_changed_p): Use cooked_read_value.
This commit is contained in:
parent
6322e5c5cb
commit
ff4ca5ac6a
2 changed files with 26 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2017-06-08 Alan Hayward <alan.hayward@arm.com>
|
||||||
|
|
||||||
|
* mi/mi-main.c (register_changed_p): Use cooked_read_value.
|
||||||
|
|
||||||
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
|
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
* NEWS (Changes since GDB 8.0): Announce that GDBserver is now
|
* NEWS (Changes since GDB 8.0): Announce that GDBserver is now
|
||||||
|
|
|
@ -1111,10 +1111,8 @@ register_changed_p (int regnum, struct regcache *prev_regs,
|
||||||
struct regcache *this_regs)
|
struct regcache *this_regs)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = get_regcache_arch (this_regs);
|
struct gdbarch *gdbarch = get_regcache_arch (this_regs);
|
||||||
gdb_byte prev_buffer[MAX_REGISTER_SIZE];
|
struct value *prev_value, *this_value;
|
||||||
gdb_byte this_buffer[MAX_REGISTER_SIZE];
|
int ret;
|
||||||
enum register_status prev_status;
|
|
||||||
enum register_status this_status;
|
|
||||||
|
|
||||||
/* First time through or after gdbarch change consider all registers
|
/* First time through or after gdbarch change consider all registers
|
||||||
as changed. */
|
as changed. */
|
||||||
|
@ -1122,16 +1120,28 @@ register_changed_p (int regnum, struct regcache *prev_regs,
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Get register contents and compare. */
|
/* Get register contents and compare. */
|
||||||
prev_status = regcache_cooked_read (prev_regs, regnum, prev_buffer);
|
prev_value = prev_regs->cooked_read_value (regnum);
|
||||||
this_status = regcache_cooked_read (this_regs, regnum, this_buffer);
|
this_value = this_regs->cooked_read_value (regnum);
|
||||||
|
gdb_assert (prev_value != NULL);
|
||||||
|
gdb_assert (this_value != NULL);
|
||||||
|
|
||||||
if (this_status != prev_status)
|
if (value_optimized_out (prev_value) != value_optimized_out (this_value)
|
||||||
return 1;
|
|| value_entirely_available (prev_value)
|
||||||
else if (this_status == REG_VALID)
|
!= value_entirely_available (this_value))
|
||||||
return memcmp (prev_buffer, this_buffer,
|
ret = 1;
|
||||||
register_size (gdbarch, regnum)) != 0;
|
if (value_optimized_out (prev_value)
|
||||||
|
|| !value_entirely_available (prev_value))
|
||||||
|
ret = 0;
|
||||||
else
|
else
|
||||||
return 0;
|
ret = memcmp (value_contents_all (prev_value),
|
||||||
|
value_contents_all (this_value),
|
||||||
|
register_size (gdbarch, regnum)) != 0;
|
||||||
|
|
||||||
|
release_value (prev_value);
|
||||||
|
release_value (this_value);
|
||||||
|
value_free (prev_value);
|
||||||
|
value_free (this_value);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a list of register number and value pairs. The valid
|
/* Return a list of register number and value pairs. The valid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue