This is the mail archive of the gdb@sources.redhat.com 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]

Re: Memory attributes triumphs over dcache


>>>>> "Frank" == Frank Ch Eigler <fche@redhat.com> writes:
Frank> What got me worried is the effect of defining a memory region (with
Frank> caching but no other flags), then doing a "target remote" download.
Frank> It proceeded one byte at a time - yuck!  If some combination of the
Frank> dcache and memattr system is at fault, this still needs to be
Frank> improved.

Thanks for pointing this out.  dcache_write_line() was totally broken.
Can you try this out?  It works fine for me, but I'm only doing small
writes.  A download might be a better test.

        --jtc

Index: dcache.c
===================================================================
RCS file: /cvs/src/src/gdb/dcache.c,v
retrieving revision 1.14
diff -c -r1.14 dcache.c
*** dcache.c	2001/03/06 08:21:06	1.14
--- dcache.c	2001/04/04 22:32:57
***************
*** 278,297 ****
        while (reg_len > 0)
  	{
  	  s = XFORM(memaddr);
! 	  do {
  	    if (db->state[s] == ENTRY_DIRTY)
  	      break;
  	    s++;
  	    reg_len--;
- 	  } while (reg_len > 0);
  
  	  e = s;
! 	  do {
  	    if (db->state[e] != ENTRY_DIRTY)
  	      break;
  	    e++;
  	    reg_len--;
! 	  } while (reg_len > 0);
  
  	  dirty_len = e - s;
  	  while (dirty_len > 0)
--- 278,301 ----
        while (reg_len > 0)
  	{
  	  s = XFORM(memaddr);
! 	  while (reg_len > 0) {
  	    if (db->state[s] == ENTRY_DIRTY)
  	      break;
  	    s++;
  	    reg_len--;
  
+ 	    memaddr++;
+ 	    myaddr++;
+ 	    len--;
+ 	  }
+ 
  	  e = s;
! 	  while (reg_len > 0) {
  	    if (db->state[e] != ENTRY_DIRTY)
  	      break;
  	    e++;
  	    reg_len--;
! 	  }
  
  	  dirty_len = e - s;
  	  while (dirty_len > 0)
***************
*** 304,309 ****
--- 308,314 ----
  	      memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
  	      memaddr   += res;
  	      myaddr    += res;
+ 	      len       -= res;
  	      dirty_len -= res;
  	    }
  	}



-- 
J.T. Conklin
RedBack Networks


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