aboutsummaryrefslogtreecommitdiff
path: root/gdb/auxv.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-01-27 17:32:33 +0800
committerYao Qi <yao@codesourcery.com>2014-02-07 11:19:58 +0800
commit2ed4b5488f68c63da0713dc008ba8b688a742386 (patch)
tree9bc671808d970999362caf23c2c1eb9ed9595f9a /gdb/auxv.c
parentc09f20e469dbed255f419433b06a2808ae0a40a8 (diff)
downloadgdb-2ed4b5488f68c63da0713dc008ba8b688a742386.zip
gdb-2ed4b5488f68c63da0713dc008ba8b688a742386.tar.gz
gdb-2ed4b5488f68c63da0713dc008ba8b688a742386.tar.bz2
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 <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. * 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.
Diffstat (limited to 'gdb/auxv.c')
-rw-r--r--gdb/auxv.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/auxv.c b/gdb/auxv.c
index dd13237..f93c7ec 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -52,7 +52,7 @@ procfs_xfer_auxv (gdb_byte *readbuf,
fd = gdb_open_cloexec (pathname, writebuf != NULL ? O_WRONLY : O_RDONLY, 0);
xfree (pathname);
if (fd < 0)
- return -1;
+ return TARGET_XFER_E_IO;
if (offset != (ULONGEST) 0
&& lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
@@ -86,10 +86,10 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL);
if (msym == NULL)
- return -1;
+ return TARGET_XFER_E_IO;
if (MSYMBOL_SIZE (msym) != ptr_size)
- return -1;
+ return TARGET_XFER_E_IO;
/* POINTER_ADDRESS is a location where the `_dl_auxv' variable
resides. DATA_ADDRESS is the inferior value present in
@@ -118,14 +118,14 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
11440. */
if (target_read_memory (pointer_address, ptr_buf, ptr_size) != 0)
- return -1;
+ return TARGET_XFER_E_IO;
data_address = extract_typed_address (ptr_buf, ptr_type);
/* Possibly still not initialized such as during an inferior
startup. */
if (data_address == 0)
- return -1;
+ return TARGET_XFER_E_IO;
data_address += offset;
@@ -134,7 +134,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
if (target_write_memory (data_address, writebuf, len) == 0)
return len;
else
- return -1;
+ return TARGET_XFER_E_IO;
}
/* Stop if trying to read past the existing AUXV block. The final
@@ -144,7 +144,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
{
if (target_read_memory (data_address - auxv_pair_size, ptr_buf,
ptr_size) != 0)
- return -1;
+ return TARGET_XFER_E_IO;
if (extract_typed_address (ptr_buf, ptr_type) == AT_NULL)
return 0;