From 2ed4b5488f68c63da0713dc008ba8b688a742386 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Mon, 27 Jan 2014 17:32:33 +0800 Subject: Replace -1 with TARGET_XFER_E_IO Hi, This patch replaces -1 with TARGET_XFER_E_IO in the implementations of to_xfer_partial and their callees. This change is quite mechanical, and makes the next patch shorter. gdb: 2014-02-07 Yao Qi * 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. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. (darwin_xfer_partial): Likewise. * exec.c (exec_xfer_partial): Likewise. * gnu-nat.c (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_uregs): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo): Likewise. (linux_proc_xfer_spu): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_qxfer): Likewise. (remote_write_qxfer, remote_read_qxfer): Likewise. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. (spu_xfer_partial): Likewise. * target.c (memory_xfer_partial_1): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. --- gdb/corelow.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'gdb/corelow.c') diff --git a/gdb/corelow.c b/gdb/corelow.c index 2d4a719..5f1e55f 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -698,7 +698,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, section = bfd_get_section_by_name (core_bfd, ".auxv"); if (section == NULL) - return -1; + return TARGET_XFER_E_IO; size = bfd_section_size (core_bfd, section); if (offset >= size) @@ -711,12 +711,12 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, (file_ptr) offset, size)) { warning (_("Couldn't read NT_AUXV note in core file.")); - return -1; + return TARGET_XFER_E_IO; } return size; } - return -1; + return TARGET_XFER_E_IO; case TARGET_OBJECT_WCOOKIE: if (readbuf) @@ -730,7 +730,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, section = bfd_get_section_by_name (core_bfd, ".wcookie"); if (section == NULL) - return -1; + return TARGET_XFER_E_IO; size = bfd_section_size (core_bfd, section); if (offset >= size) @@ -743,19 +743,19 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, (file_ptr) offset, size)) { warning (_("Couldn't read StackGhost cookie in core file.")); - return -1; + return TARGET_XFER_E_IO; } return size; } - return -1; + return TARGET_XFER_E_IO; case TARGET_OBJECT_LIBRARIES: if (core_gdbarch && gdbarch_core_xfer_shared_libraries_p (core_gdbarch)) { if (writebuf) - return -1; + return TARGET_XFER_E_IO; return gdbarch_core_xfer_shared_libraries (core_gdbarch, readbuf, offset, len); @@ -767,7 +767,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, && gdbarch_core_xfer_shared_libraries_aix_p (core_gdbarch)) { if (writebuf) - return -1; + return TARGET_XFER_E_IO; return gdbarch_core_xfer_shared_libraries_aix (core_gdbarch, readbuf, offset, len); @@ -789,7 +789,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, section = bfd_get_section_by_name (core_bfd, sectionstr); if (section == NULL) - return -1; + return TARGET_XFER_E_IO; size = bfd_section_size (core_bfd, section); if (offset >= size) @@ -802,7 +802,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, (file_ptr) offset, size)) { warning (_("Couldn't read SPU section in core file.")); - return -1; + return TARGET_XFER_E_IO; } return size; @@ -820,19 +820,19 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, bfd_map_over_sections (core_bfd, add_to_spuid_list, &list); return list.written; } - return -1; + return TARGET_XFER_E_IO; case TARGET_OBJECT_SIGNAL_INFO: if (readbuf) return get_core_siginfo (core_bfd, readbuf, offset, len); - return -1; + return TARGET_XFER_E_IO; default: if (ops->beneath != NULL) return ops->beneath->to_xfer_partial (ops->beneath, object, annex, readbuf, writebuf, offset, len); - return -1; + return TARGET_XFER_E_IO; } } -- cgit v1.1