/* Caching code for GDB, the GNU debugger.
- Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free
- Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2007
+ Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include "defs.h"
#include "dcache.h"
}
dirty_len = e - s;
- while (dirty_len > 0)
- {
- res = do_xfer_memory(memaddr, myaddr, dirty_len, 1,
- ®ion->attrib);
- if (res <= 0)
- return 0;
-
- memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
- memaddr += res;
- myaddr += res;
- len -= res;
- dirty_len -= res;
- }
+ res = target_write (¤t_target, TARGET_OBJECT_RAW_MEMORY,
+ NULL, myaddr, memaddr, dirty_len);
+ if (res < dirty_len)
+ return 0;
+
+ memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
+ memaddr += res;
+ myaddr += res;
+ len -= res;
}
}
continue;
}
- while (reg_len > 0)
- {
- res = do_xfer_memory (memaddr, myaddr, reg_len, 0,
- ®ion->attrib);
- if (res <= 0)
- return 0;
+ res = target_read (¤t_target, TARGET_OBJECT_RAW_MEMORY,
+ NULL, myaddr, memaddr, reg_len);
+ if (res < reg_len)
+ return 0;
- memaddr += res;
- myaddr += res;
- len -= res;
- reg_len -= res;
- }
+ memaddr += res;
+ myaddr += res;
+ len -= res;
}
memset (db->state, ENTRY_OK, sizeof (db->data));