From: Pedro Alves <palves@redhat.com>
To: Alan Hayward <Alan.Hayward@arm.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from mi/mi-main.c
Date: Thu, 08 Jun 2017 09:55:00 -0000 [thread overview]
Message-ID: <0fd04925-3200-53b9-5a7d-904ea028c3b0@redhat.com> (raw)
In-Reply-To: <4AA96E9D-7905-4D03-9424-2BC71D117CE2@arm.com>
On 06/08/2017 10:42 AM, Alan Hayward wrote:
> /* Get register contents and compare. */
> - prev_status = regcache_cooked_read (prev_regs, regnum, prev_buffer);
> - this_status = regcache_cooked_read (this_regs, regnum, this_buffer);
> -
> - if (this_status != prev_status)
> - return 1;
> - else if (this_status == REG_VALID)
> - return memcmp (prev_buffer, this_buffer,
> - register_size (gdbarch, regnum)) != 0;
> + prev_value = prev_regs->cooked_read_value (regnum);
> + this_value = this_regs->cooked_read_value (regnum);
> + gdb_assert (prev_value != NULL);
> + gdb_assert (this_value != NULL);
> +
> + if (value_optimized_out (prev_value) != value_optimized_out (this_value)
> + || value_entirely_available (prev_value)
> + != value_entirely_available (this_value))
> + ret = 1;
> + if (value_optimized_out (prev_value)
> + || !value_entirely_available (prev_value))
> + ret = 0;
> 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;
> }
>
Use value_contents_eq?
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-06-08 9:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 9:42 Alan Hayward
2017-06-08 9:55 ` Pedro Alves [this message]
2017-06-08 12:57 ` Alan Hayward
2017-06-08 13:00 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0fd04925-3200-53b9-5a7d-904ea028c3b0@redhat.com \
--to=palves@redhat.com \
--cc=Alan.Hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).