This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove MAX_REGISTER_SIZE from regcache.c
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Fri, 24 Mar 2017 08:49:06 +0000
- Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from regcache.c
- Authentication-results: sourceware.org; auth=none
- References: <562B2F6F-F3C6-4A76-9489-57539F396C94@arm.com>
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 (齐尧)