[PATCH] Remove MAX_REGISTER_SIZE from regcache.c
Yao Qi
qiyaoltc@gmail.com
Fri Mar 24 08:49:00 GMT 2017
Alan Hayward <Alan.Hayward@arm.com> writes:
> @@ -126,6 +129,8 @@ init_regcache_descr (struct gdbarch *gdbarch)
> descr->register_offset[i] = offset;
> offset += descr->sizeof_register[i];
> gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]);
Do we still need to keep MAX_REGISTER_SIZE? or you plan to remove it later.
> + descr->max_register_size = std::max (descr->max_register_size,
> + descr->sizeof_register[i]);
> }
> /* Set the real size of the raw register cache buffer. */
> descr->sizeof_raw_registers = offset;
> @@ -1465,17 +1473,19 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
> fprintf_unfiltered (file, "Cooked value");
> else
> {
> - enum register_status status;
> + struct value *value = regcache_cooked_read_value (regcache,
> + regnum);
>
> - status = regcache_cooked_read (regcache, regnum, buf);
> - if (status == REG_UNKNOWN)
> - fprintf_unfiltered (file, "<invalid>");
"<invalid>" is lost after your patch.
> - else if (status == REG_UNAVAILABLE)
> + if (value_optimized_out (value)
> + || !value_entirely_available (value))
> fprintf_unfiltered (file, "<unavailable>");
> else
> - print_hex_chars (file, buf,
> + print_hex_chars (file, value_contents_all (value),
> regcache->descr->sizeof_register[regnum],
> gdbarch_byte_order (gdbarch));
> +
> + release_value (value);
> + value_free (value);
--
Yao (齐尧)
More information about the Gdb-patches
mailing list