diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-10-01 16:12:26 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-10-01 16:12:26 +0000 |
commit | cb85a953947f35d14a49eff8f67f82b36f3cf984 (patch) | |
tree | c5acb18e11d613b5e7d7e80d3c5622c4255c45b5 /gdb/target.c | |
parent | 40a18ebd3ae910042b4d7bf053a41c247db7cbc1 (diff) | |
download | gdb-cb85a953947f35d14a49eff8f67f82b36f3cf984.zip gdb-cb85a953947f35d14a49eff8f67f82b36f3cf984.tar.gz gdb-cb85a953947f35d14a49eff8f67f82b36f3cf984.tar.bz2 |
2004-10-01 Andrew Cagney <cagney@gnu.org>
* target.c (xfer_using_stratum): Change return type to LONGEST.
On each iteration offset, readbuf and writebuf.
* inf-ptrace.c (inf_ptrace_xfer_partial): Simplify computation of
partial_length, and read/modify/write predicate, update comments.
Pass buffer.word to ptrace write.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/target.c b/gdb/target.c index 81784da..48bf8fb 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -927,9 +927,9 @@ target_xfer_partial (struct target_ops *ops, implementing another singluar mechanism (for instance, a generic object:annex onto inferior:object:annex say). */ -static int +static LONGEST xfer_using_stratum (enum target_object object, const char *annex, - CORE_ADDR memaddr, int len, void *readbuf, + ULONGEST offset, LONGEST len, void *readbuf, const void *writebuf) { LONGEST xfered; @@ -946,7 +946,7 @@ xfer_using_stratum (enum target_object object, const char *annex, while (1) { xfered = target_xfer_partial (target, object, annex, - readbuf, writebuf, memaddr, len); + readbuf, writebuf, offset, len); if (xfered > 0) { /* The partial xfer succeeded, update the counts, check that @@ -955,6 +955,11 @@ xfer_using_stratum (enum target_object object, const char *annex, len -= xfered; if (len <= 0) return 0; + offset += xfered; + if (readbuf != NULL) + readbuf = (bfd_byte *) readbuf + xfered; + if (writebuf != NULL) + writebuf = (bfd_byte *) writebuf + xfered; target = target_stack; } else if (xfered < 0) |