* record.c (record_core_xfer_partial): Pass correct offset to
authorDoug Evans <dje@google.com>
Fri, 23 Oct 2009 17:12:25 +0000 (17:12 +0000)
committerDoug Evans <dje@google.com>
Fri, 23 Oct 2009 17:12:25 +0000 (17:12 +0000)
record_beneath_to_xfer_partial.

gdb/ChangeLog
gdb/record.c

index 0d67b091173c31766186380ac05581ffcccca18d..99868750c40ead7fa04099666587ce0e7329f2c7 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-23  Doug Evans  <dje@google.com>
+
+       * record.c (record_core_xfer_partial): Pass correct offset to
+       record_beneath_to_xfer_partial.
+
 2009-10-23  Michael Snyder  <msnyder@vmware.com>
 
        * record.c (netorder64): Use BFD_ENDIAN_LITTLE not LITTLE_ENDIAN.
index 98c794fbfa43143c3c41553f346b2c3865d8faeb..946ebf1108d0e33be6ecbca44197d2574d7bc231 100644 (file)
@@ -1629,6 +1629,7 @@ record_core_xfer_partial (struct target_ops *ops, enum target_object object,
                if (offset >= p->addr)
                  {
                    struct record_core_buf_entry *entry;
+                  ULONGEST sec_offset;
 
                    if (offset >= p->endaddr)
                      continue;
@@ -1636,7 +1637,7 @@ record_core_xfer_partial (struct target_ops *ops, enum target_object object,
                    if (offset + len > p->endaddr)
                      len = p->endaddr - offset;
 
-                   offset -= p->addr;
+                   sec_offset = offset - p->addr;
 
                    /* Read readbuf or write writebuf p, offset, len.  */
                    /* Check flags.  */
@@ -1673,7 +1674,8 @@ record_core_xfer_partial (struct target_ops *ops, enum target_object object,
                            record_core_buf_list = entry;
                          }
 
-                        memcpy (entry->buf + offset, writebuf, (size_t) len);
+                        memcpy (entry->buf + sec_offset, writebuf,
+                               (size_t) len);
                      }
                    else
                      {
@@ -1683,7 +1685,8 @@ record_core_xfer_partial (struct target_ops *ops, enum target_object object,
                                    object, annex, readbuf, writebuf,
                                    offset, len);
 
-                       memcpy (readbuf, entry->buf + offset, (size_t) len);
+                       memcpy (readbuf, entry->buf + sec_offset,
+                              (size_t) len);
                      }
 
                    return len;