This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Read memory in multiple lines in dcache_xfer_memory.
- From: Doug Evans <dje at google dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 21 Oct 2013 16:15:55 -0700
- Subject: Re: [PATCH 2/2] Read memory in multiple lines in dcache_xfer_memory.
- Authentication-results: sourceware.org; auth=none
- References: <1382066466-2551-1-git-send-email-yao at codesourcery dot com> <1382066466-2551-3-git-send-email-yao at codesourcery dot com>
Yao Qi writes:
> [...]
> 2013-10-18 Yao Qi <yao@codesourcery.com>
>
> * dcache.c: Include "memrange.h".
> Update comments.
> (dcache_read_line): Remove.
> (dcache_peek_byte): Remove.
> (dcache_ranges_readable): New function.
> (dcache_ranges_uncached): New function.
> (dcache_xfer_memory): Read multiple cache lines from target
> memory in one time.
> [...]
> + for (i = 0; VEC_iterate (mem_range_s, uncached, i, r); i++)
> {
> - if (!dcache_peek_byte (dcache, memaddr + i, myaddr + i))
> + int j;
> +
> + if (cached_addr < r->start)
> {
> - /* That failed. Discard its cache line so we don't have a
> - partially read line. */
> - dcache_invalidate_line (dcache, memaddr + i);
> - return i;
> + /* Read memory [cached_addr, MIN (r->start, MEMADDR + LEN))
> + from cache lines. */
> +
> + for (; cached_addr < r->start && cached_addr < (memaddr + len);
> + cached_addr++)
> + {
> + struct dcache_block *db = dcache_hit (dcache, cached_addr);
> +
> + gdb_assert (db != NULL);
Hi.
Going through the code ...
This assert will trigger if the request ends up filling the cache
and existing lines get pushed out, right?
[There's a similar assert later in the function too.]
Could be missing something of course.