From: David Gibson <david@gibson.dropbear.id.au>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
qemu-ppc@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH v3 09/10] gdbstub: Convert target_memory_rw_debug to use MemoryAccessType
Date: Thu, 21 Jul 2016 11:48:27 +1000 [thread overview]
Message-ID: <20160721014827.GA31439@voom.fritz.box> (raw)
In-Reply-To: <1468990980-4598-10-git-send-email-andrew.smirnov@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2391 bytes --]
On Tue, Jul 19, 2016 at 10:02:59PM -0700, Andrey Smirnov wrote:
> Convert target_memory_rw_debug to use MemoryAccessType as to follow
> similar conversion of cpu_memory_rw_debug.
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> gdbstub.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 9c4cbe4..c215672 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -44,15 +44,17 @@
> #endif
>
> static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
> - uint8_t *buf, int len, bool is_write)
> + uint8_t *buf, int len,
> + MemoryAccessType access_type)
> {
> CPUClass *cc = CPU_GET_CLASS(cpu);
>
> if (cc->memory_rw_debug) {
> + const bool is_write = (access_type == MEM_DATA_STORE);
> return cc->memory_rw_debug(cpu, addr, buf, len, is_write);
> }
> - return cpu_memory_rw_debug(cpu, addr, buf, len,
> - is_write ? MEM_DATA_STORE : MEM_DATA_LOAD);
> +
> + return cpu_memory_rw_debug(cpu, addr, buf, len, access_type);
> }
>
> enum {
> @@ -966,7 +968,8 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
> break;
> }
>
> - if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len, false) != 0) {
> + if (target_memory_rw_debug(s->g_cpu, addr, mem_buf,
> + len, MEM_DATA_LOAD) != 0) {
> put_packet (s, "E14");
> } else {
> memtohex(buf, mem_buf, len);
> @@ -988,7 +991,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
> }
> hextomem(mem_buf, p, len);
> if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len,
> - true) != 0) {
> + MEM_DATA_STORE) != 0) {
> put_packet(s, "E14");
> } else {
> put_packet(s, "OK");
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-07-21 1:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-20 5:02 [PATCH v3 00/10] Support non-direct memory writes in cpu_memory_rw_debug Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 01/10] Avoid needless calls to address_space_rw() Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 02/10] Change signature of address_space_read() to avoid casting Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 03/10] Change signature of address_space_write() " Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 04/10] address_space_write_continue: Distill common code Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 05/10] Rename MMUAccessType to MemoryAccessType Andrey Smirnov
2016-07-20 9:34 ` David Gibson
2016-07-20 5:02 ` [PATCH v3 06/10] Change signature of cpu_memory_rw_debug() to avoid casting Andrey Smirnov
2016-07-20 5:02 ` [PATCH v3 07/10] Convert cpu_memory_rw_debug to use MemoryAccessType Andrey Smirnov
2016-07-20 9:45 ` David Gibson
2016-07-20 5:02 ` [PATCH v3 08/10] Convert address_space_rw " Andrey Smirnov
2016-07-21 1:47 ` David Gibson
2016-07-20 5:02 ` [PATCH v3 09/10] gdbstub: Convert target_memory_rw_debug " Andrey Smirnov
2016-07-21 1:48 ` David Gibson [this message]
2016-07-20 5:03 ` [PATCH v3 10/10] exec: Use address_space_rw to handle reads and wirtes Andrey Smirnov
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=20160721014827.GA31439@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=andrew.smirnov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 NNTP newsgroup(s).