This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Delegate to target_ops->beneath to read cache lines
- From: Doug Evans <xdje42 at gmail dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 29 Nov 2013 11:42:04 -0800
- Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines
- Authentication-results: sourceware.org; auth=none
- References: <1385554824-7159-1-git-send-email-yao at codesourcery dot com> <5295F877 dot 3060004 at redhat dot com> <52980180 dot 1050000 at codesourcery dot com>
On Thu, Nov 28, 2013 at 6:52 PM, Yao Qi <yao@codesourcery.com> wrote:
> [...]
> 2013-11-29 Yao Qi <yao@codesourcery.com>
> Pedro Alves <palves@redhat.com>
>
> * dcache.c (dcache_read_line): Use current_target.beneath
> instead of ¤t_target.
> * target.c (memory_xfer_partial_1): Factor code out to ...
> (raw_memory_xfer_partial): ... it. New function.
> (target_xfer_partial): Call raw_memory_xfer_partial if OBJECT
> is TARGET_OBJECT_RAW_MEMORY.
> ---
> gdb/dcache.c | 4 +-
> gdb/target.c | 67 ++++++++++++++++++++++++++++++++--------------------------
> 2 files changed, 39 insertions(+), 32 deletions(-)
>
> diff --git a/gdb/dcache.c b/gdb/dcache.c
> index ea2b732..12d1a4b 100644
> --- a/gdb/dcache.c
> +++ b/gdb/dcache.c
> @@ -336,8 +336,8 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
> len -= reg_len;
> continue;
> }
> -
> - res = target_read (¤t_target, TARGET_OBJECT_RAW_MEMORY,
> +
> + res = target_read (current_target.beneath, TARGET_OBJECT_RAW_MEMORY,
> NULL, myaddr, memaddr, reg_len);
> if (res < reg_len)
> return 0;
> [...]
I think a comment is required here explaining why things are the way they are.
i.e., why we use current_target.beneath instead of ¤t_target.