Fix ehframe header handling for shared libraries.
[deliverable/binutils-gdb.git] / gdb / dcache.c
index 43640b0e48e38f9e1bcb9f35ddb87a3027b5756c..0cfb390ca5a1011fb2ad2ac53a0074ed363fd7f1 100644 (file)
@@ -1,13 +1,13 @@
 /* Caching code for GDB, the GNU debugger.
 
-   Copyright (C) 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.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    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., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "dcache.h"
@@ -302,19 +300,15 @@ dcache_write_line (DCACHE *dcache, struct dcache_block *db)
          }
 
          dirty_len = e - s;
-         while (dirty_len > 0)
-           {
-             res = do_xfer_memory(memaddr, myaddr, dirty_len, 1,
-                                  &region->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 (&current_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;
        }
     }
 
@@ -361,18 +355,14 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
          continue;
        }
       
-      while (reg_len > 0)
-       {
-         res = do_xfer_memory (memaddr, myaddr, reg_len, 0,
-                               &region->attrib);
-         if (res <= 0)
-           return 0;
+      res = target_read (&current_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));
This page took 0.02452 seconds and 4 git commands to generate.