const char *args);
static void mi_execute_async_cli_command (const char *cli_command,
char **argv, int argc);
-static int register_changed_p (int regnum, struct regcache *,
- struct regcache *);
+static bool register_changed_p (int regnum, regcache *,
+ regcache *);
static void output_register (struct frame_info *, int regnum, int format,
int skip_unavailable);
struct ui_out *uiout = current_uiout;
std::unique_ptr<struct regcache> prev_regs;
struct gdbarch *gdbarch;
- int regnum, numregs, changed;
+ int regnum, numregs;
int i;
/* The last time we visited this function, the current frame's
if (gdbarch_register_name (gdbarch, regnum) == NULL
|| *(gdbarch_register_name (gdbarch, regnum)) == '\0')
continue;
- changed = register_changed_p (regnum, prev_regs.get (),
- this_regs.get ());
- if (changed < 0)
- error (_("-data-list-changed-registers: "
- "Unable to read register contents."));
- else if (changed)
+
+ if (register_changed_p (regnum, prev_regs.get (),
+ this_regs.get ()))
uiout->field_int (NULL, regnum);
}
}
&& gdbarch_register_name (gdbarch, regnum) != NULL
&& *gdbarch_register_name (gdbarch, regnum) != '\000')
{
- changed = register_changed_p (regnum, prev_regs.get (),
- this_regs.get ());
- if (changed < 0)
- error (_("-data-list-changed-registers: "
- "Unable to read register contents."));
- else if (changed)
+ if (register_changed_p (regnum, prev_regs.get (),
+ this_regs.get ()))
uiout->field_int (NULL, regnum);
}
else
}
}
-static int
+static bool
register_changed_p (int regnum, struct regcache *prev_regs,
struct regcache *this_regs)
{
struct gdbarch *gdbarch = this_regs->arch ();
struct value *prev_value, *this_value;
- int ret;
/* First time through or after gdbarch change consider all registers
as changed. */
if (!prev_regs || prev_regs->arch () != gdbarch)
- return 1;
+ return true;
/* Get register contents and compare. */
prev_value = prev_regs->cooked_read_value (regnum);
gdb_assert (prev_value != NULL);
gdb_assert (this_value != NULL);
- ret = value_contents_eq (prev_value, 0, this_value, 0,
- register_size (gdbarch, regnum)) == 0;
+ auto ret = value_contents_eq (prev_value, 0, this_value, 0,
+ register_size (gdbarch, regnum)) == 0;
release_value (prev_value);
release_value (this_value);