diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/target.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6601b48..6bcc205 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2014-02-07 Yao Qi <yao@codesourcery.com> + * target.c (target_xfer_partial): Return zero if LEN is zero. + +2014-02-07 Yao Qi <yao@codesourcery.com> + * auxv.c (procfs_xfer_auxv): Replace -1 with TARGET_XFER_E_IO. (ld_so_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. diff --git a/gdb/target.c b/gdb/target.c index 3ca3e71..65a226e 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1697,6 +1697,10 @@ target_xfer_partial (struct target_ops *ops, gdb_assert (ops->to_xfer_partial != NULL); + /* Transfer is done when LEN is zero. */ + if (len == 0) + return 0; + if (writebuf && !may_write_memory) error (_("Writing to memory is not allowed (addr %s, len %s)"), core_addr_to_string_nz (offset), plongest (len)); |