This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Read memory in multiple lines in dcache_xfer_memory.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]