From: Doug Evans Date: Fri, 23 Oct 2009 17:12:25 +0000 (+0000) Subject: * record.c (record_core_xfer_partial): Pass correct offset to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bcbfd75943661d391dea442519ed619513beeaf2;p=binutils-gdb.git * record.c (record_core_xfer_partial): Pass correct offset to record_beneath_to_xfer_partial. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0d67b091173..99868750c40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-10-23 Doug Evans + + * record.c (record_core_xfer_partial): Pass correct offset to + record_beneath_to_xfer_partial. + 2009-10-23 Michael Snyder * record.c (netorder64): Use BFD_ENDIAN_LITTLE not LITTLE_ENDIAN. diff --git a/gdb/record.c b/gdb/record.c index 98c794fbfa4..946ebf1108d 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -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;