Replace -1 with TARGET_XFER_E_IO
authorYao Qi <yao@codesourcery.com>
Mon, 27 Jan 2014 09:32:33 +0000 (17:32 +0800)
committerYao Qi <yao@codesourcery.com>
Fri, 7 Feb 2014 03:19:58 +0000 (11:19 +0800)
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.

23 files changed:
gdb/ChangeLog
gdb/auxv.c
gdb/bfd-target.c
gdb/bsd-kvm.c
gdb/corelow.c
gdb/ctf.c
gdb/darwin-nat.c
gdb/exec.c
gdb/gnu-nat.c
gdb/ia64-hpux-nat.c
gdb/inf-ptrace.c
gdb/inf-ttrace.c
gdb/linux-nat.c
gdb/procfs.c
gdb/record-full.c
gdb/remote-sim.c
gdb/remote.c
gdb/rs6000-nat.c
gdb/sparc-nat.c
gdb/spu-linux-nat.c
gdb/target.c
gdb/tracepoint.c
gdb/windows-nat.c

index 146ac98faebfd5d989306d461a2e1f6c75154ed1..6601b480acef738346ae0b3fe9df4234b85e5219 100644 (file)
@@ -1,3 +1,37 @@
+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.
+
 2014-02-07  Yao Qi  <yao@codesourcery.com>
 
        * gdbarch.sh (core_xfer_shared_libraries): Returns ULONGEST.  Add
index dd13237dd0c76a5869a833b59c0047900730464a..f93c7ec85e9001cb706cca685431e98234edcf8e 100644 (file)
@@ -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;
index 657de357d5f1bd23a7876dd51a40722b072a1f98..41930ee5544ea71e43db1043cbbd082a2a24311f 100644 (file)
@@ -55,7 +55,7 @@ target_bfd_xfer_partial (struct target_ops *ops,
                                                  NULL);
       }
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index cfa8867151cf8143d47cce9fcc1ed1bd40c3cdcd..36b33e93b6ea5445d208c03c5b73123ddc3930d4 100644 (file)
@@ -143,7 +143,7 @@ bsd_kvm_xfer_partial (struct target_ops *ops, enum target_object object,
       return bsd_kvm_xfer_memory (offset, len, readbuf, writebuf);
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index 2d4a71987742ddf674da96201f8959ba9040215b..5f1e55faedd41da20110cd153418713f523796b5 100644 (file)
@@ -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;
     }
 }
 
index 6035c2bc122caa8b61a855a171b0995e013f4b8a..54cf56be9c1056b137a657770a55146e574f2087 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1493,7 +1493,7 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
     }
 
   /* Indicate failure to find the requested memory block.  */
-  return -1;
+  return TARGET_XFER_E_IO;
 }
 
 /* This is the implementation of target_ops method
index dd4b3ce1775008364390da4188a8c1ba7b51e5c5..0b1d59c13ac398b1cd643ffec291ec034d374cb3 100644 (file)
@@ -1907,7 +1907,7 @@ darwin_read_dyld_info (task_t task, CORE_ADDR addr, gdb_byte *rdaddr,
   kret = task_info (task, TASK_DYLD_INFO, (task_info_t) &task_dyld_info, &count);
   MACH_CHECK_ERROR (kret);
   if (kret != KERN_SUCCESS)
-    return -1;
+    return TARGET_XFER_E_IO;
   /* Truncate.  */
   if (addr + length > sz)
     length = sz - addr;
@@ -1942,12 +1942,12 @@ darwin_xfer_partial (struct target_ops *ops,
       if (writebuf != NULL || readbuf == NULL)
         {
           /* Support only read.  */
-          return -1;
+          return TARGET_XFER_E_IO;
         }
       return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
 #endif
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 
 }
index b5aa7f288c9c097edaa0f06aefdf55cd4ba5c1bd..3ec6c2f124eb110a9b1eab56d27d0c2a7f595c91 100644 (file)
@@ -650,7 +650,7 @@ exec_xfer_partial (struct target_ops *ops, enum target_object object,
                                              table->sections_end,
                                              NULL);
   else
-    return -1;
+    return TARGET_XFER_E_IO;
 }
 \f
 
index ca61c11306a4e895c88cdda361f67e1a7101ffb5..737496234c5cbe9e2376c544894110ec3b54b7a5 100644 (file)
@@ -2520,7 +2520,7 @@ gnu_xfer_partial (struct target_ops *ops, enum target_object object,
       return gnu_xfer_memory (readbuf, writebuf, offset, len);
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index 2b0e88990fcf713769fe55ba0d26957fccb34917..b783c99d2e9aa17c923592c02b71433c49290dbf 100644 (file)
@@ -630,7 +630,7 @@ ia64_hpux_xfer_uregs (struct target_ops *ops, const char *annex,
 
   status = ia64_hpux_read_register_from_save_state_t (offset, readbuf, len);
   if (status < 0)
-    return -1;
+    return TARGET_XFER_E_IO;
   return len;
 }
 
index a64c8764ed1b75309b160ab9f70007aeb4f257f5..dc3746b0ad8d83db55c33c5a5cf6137892e08d16 100644 (file)
@@ -573,7 +573,7 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
       }
 
     case TARGET_OBJECT_UNWIND_TABLE:
-      return -1;
+      return TARGET_XFER_E_IO;
 
     case TARGET_OBJECT_AUXV:
 #if defined (PT_IO) && defined (PIOD_READ_AUXV)
@@ -584,7 +584,7 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
        struct ptrace_io_desc piod;
 
        if (writebuf)
-         return -1;
+         return TARGET_XFER_E_IO;
        piod.piod_op = PIOD_READ_AUXV;
        piod.piod_addr = readbuf;
        piod.piod_offs = (void *) (long) offset;
@@ -596,13 +596,13 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
          return piod.piod_len;
       }
 #endif
-      return -1;
+      return TARGET_XFER_E_IO;
 
     case TARGET_OBJECT_WCOOKIE:
-      return -1;
+      return TARGET_XFER_E_IO;
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index ea76153c6ecd305eead009e5d70f9d4e0099f37d..3fd98f2eaa42d6ec3607546426d8bbf10c8cbf4d 100644 (file)
@@ -1234,16 +1234,16 @@ inf_ttrace_xfer_partial (struct target_ops *ops, enum target_object object,
       return inf_ttrace_xfer_memory (offset, len, readbuf, writebuf);
 
     case TARGET_OBJECT_UNWIND_TABLE:
-      return -1;
+      return TARGET_XFER_E_IO;
 
     case TARGET_OBJECT_AUXV:
-      return -1;
+      return TARGET_XFER_E_IO;
 
     case TARGET_OBJECT_WCOOKIE:
-      return -1;
+      return TARGET_XFER_E_IO;
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index d144c7772e9a4b105599f4afdff3f2c922372fba..ebf40559f037b5c6155b40d07c78b407bb71b270 100644 (file)
@@ -3879,12 +3879,12 @@ linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
     pid = ptid_get_pid (inferior_ptid);
 
   if (offset > sizeof (siginfo))
-    return -1;
+    return TARGET_XFER_E_IO;
 
   errno = 0;
   ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
   if (errno != 0)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   /* When GDB is built as a 64-bit application, ptrace writes into
      SIGINFO an object with 64-bit layout.  Since debugging a 32-bit
@@ -3909,7 +3909,7 @@ linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
       errno = 0;
       ptrace (PTRACE_SETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
       if (errno != 0)
-       return -1;
+       return TARGET_XFER_E_IO;
     }
 
   return len;
@@ -4219,7 +4219,7 @@ linux_proc_xfer_spu (struct target_ops *ops, enum target_object object,
   if (!annex)
     {
       if (!readbuf)
-       return -1;
+       return TARGET_XFER_E_IO;
       else
        return spu_enumerate_spu_ids (pid, readbuf, offset, len);
     }
@@ -4227,7 +4227,7 @@ linux_proc_xfer_spu (struct target_ops *ops, enum target_object object,
   xsnprintf (buf, sizeof buf, "/proc/%d/fd/%s", pid, annex);
   fd = gdb_open_cloexec (buf, writebuf? O_WRONLY : O_RDONLY, 0);
   if (fd <= 0)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   if (offset != 0
       && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
index 2383366ab35b0b0afa3a0685a1d63ed82d881b35..d1a24ab1ef7641d9253b7e4e57325f078eda922c 100644 (file)
@@ -3987,7 +3987,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
       if (writebuf)
        return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
                                               len, 1/*write*/, NULL, ops);
-      return -1;
+      return TARGET_XFER_E_IO;
 
 #ifdef NEW_PROC_API
     case TARGET_OBJECT_AUXV:
@@ -3999,7 +3999,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
       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;
     }
 }
 
index 9a2b5e6630e0fa1d70a1b9abbe260ef73e61ad84..2859112f97dcf6d917f9052c6bc818b1bd4cd85e 100644 (file)
@@ -1685,7 +1685,7 @@ record_full_xfer_partial (struct target_ops *ops, enum target_object object,
            fprintf_unfiltered (gdb_stdlog,
                                "Process record: failed to record "
                                "execution log.");
-         return -1;
+         return TARGET_XFER_E_IO;
        }
       if (record_full_arch_list_add_end ())
        {
@@ -1694,7 +1694,7 @@ record_full_xfer_partial (struct target_ops *ops, enum target_object object,
            fprintf_unfiltered (gdb_stdlog,
                                "Process record: failed to record "
                                "execution log.");
-         return -1;
+         return TARGET_XFER_E_IO;
        }
       record_full_list->next = record_full_arch_list_head;
       record_full_arch_list_head->prev = record_full_list;
@@ -2270,7 +2270,7 @@ record_full_core_xfer_partial (struct target_ops *ops,
                }
            }
 
-         return -1;
+         return TARGET_XFER_E_IO;
        }
       else
        error (_("You can't do that without a process to debug."));
index 93090875880a497a35be3edd8a09c4c55636d6be..0322c1da2e2fe62cdbf9a4a3e2e351211c2f5bd1 100644 (file)
@@ -1124,7 +1124,7 @@ gdbsim_xfer_partial (struct target_ops *ops, enum target_object object,
       return gdbsim_xfer_memory (ops, readbuf, writebuf, offset, len);
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
index e1d0a64d2115c24aa04eb42c4312f6b877056bea..da0f64a75013f852e178c0c5a347fa83ee68e00d 100644 (file)
@@ -8749,7 +8749,7 @@ remote_write_qxfer (struct target_ops *ops, const char *object_name,
   int max_size = get_memory_write_packet_size (); 
 
   if (packet->support == PACKET_DISABLE)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   /* Insert header.  */
   i = snprintf (rs->buf, max_size, 
@@ -8765,7 +8765,7 @@ remote_write_qxfer (struct target_ops *ops, const char *object_name,
   if (putpkt_binary (rs->buf, i + buf_len) < 0
       || getpkt_sane (&rs->buf, &rs->buf_size, 0) < 0
       || packet_ok (rs->buf, packet) != PACKET_OK)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   unpack_varlen_hex (rs->buf, &n);
   return n;
@@ -8788,7 +8788,7 @@ remote_read_qxfer (struct target_ops *ops, const char *object_name,
   LONGEST i, n, packet_len;
 
   if (packet->support == PACKET_DISABLE)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   /* Check whether we've cached an end-of-object packet that matches
      this request.  */
@@ -8818,12 +8818,12 @@ remote_read_qxfer (struct target_ops *ops, const char *object_name,
            phex_nz (n, sizeof n));
   i = putpkt (rs->buf);
   if (i < 0)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   rs->buf[0] = '\0';
   packet_len = getpkt_sane (&rs->buf, &rs->buf_size, 0);
   if (packet_len < 0 || packet_ok (rs->buf, packet) != PACKET_OK)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   if (rs->buf[0] != 'l' && rs->buf[0] != 'm')
     error (_("Unknown remote qXfer reply: %s"), rs->buf);
@@ -8920,7 +8920,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
                                  &remote_protocol_packets
                                  [PACKET_qXfer_statictrace_read]);
       else
-       return -1;
+       return TARGET_XFER_E_IO;
     }
 
   /* Only handle flash writes.  */
@@ -8934,7 +8934,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
          return remote_flash_write (ops, offset, len, writebuf);
 
        default:
-         return -1;
+         return TARGET_XFER_E_IO;
        }
     }
 
@@ -9002,7 +9002,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
         &remote_protocol_packets[PACKET_qXfer_btrace]);
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 
   /* Note: a zero OFFSET and LEN can be used to query the minimum
@@ -9012,7 +9012,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
   /* Minimum outbuf size is get_remote_packet_size ().  If LEN is not
      large enough let the caller deal with it.  */
   if (len < get_remote_packet_size ())
-    return -1;
+    return TARGET_XFER_E_IO;
   len = get_remote_packet_size ();
 
   /* Except for querying the minimum buffer size, target must be open.  */
@@ -9044,7 +9044,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
 
   i = putpkt (rs->buf);
   if (i < 0)
-    return i;
+    return TARGET_XFER_E_IO;
 
   getpkt (&rs->buf, &rs->buf_size, 0);
   strcpy ((char *) readbuf, rs->buf);
index 676edd9be5e68cdec56e7b45a09a6d321b4488c3..ec3f8123c0044c7cc6ee5a5c18f3250c59c3f241 100644 (file)
@@ -476,7 +476,7 @@ rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
       }
 
     default:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 }
 
@@ -697,7 +697,7 @@ rs6000_xfer_shared_libraries
   gdb_assert (target_has_execution);
 
   if (writebuf)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   ldi_buf = rs6000_ptrace_ldinfo (inferior_ptid);
   gdb_assert (ldi_buf != NULL);
index 2953c7c0c5b69a61740df289981162801b3d1d18..05be02d1d960e376e047cc3cb49ce2591b898560 100644 (file)
@@ -272,7 +272,7 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
   if (offset == sizeof (unsigned long))
     return 0;                  /* Signal EOF.  */
   if (offset > sizeof (unsigned long))
-    return -1;
+    return TARGET_XFER_E_IO;
 
 #ifdef PT_WCOOKIE
   /* If PT_WCOOKIE is defined (by <sys/ptrace.h>), assume we're
index 784939be419e20bfa853f2d5758eaa872dd43174..a095dfb8b3b282f056b7ea71fe60aefc37069b6e 100644 (file)
@@ -244,7 +244,7 @@ spu_proc_xfer_spu (const char *annex, gdb_byte *readbuf,
   xsnprintf (buf, sizeof buf, "/proc/%d/fd/%s", pid, annex);
   fd = open (buf, writebuf? O_WRONLY : O_RDONLY);
   if (fd <= 0)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   if (offset != 0
       && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
@@ -601,7 +601,7 @@ spu_xfer_partial (struct target_ops *ops,
                                offset & lslr, len);
     }
 
-  return -1;
+  return TARGET_XFER_E_IO;
 }
 
 /* Override the to_can_use_hw_breakpoint routine.  */
index 3d63ada5ad50d856c324c93a4283a675064fe50e..3ca3e71fb63a719ae28e69bf0d863510c314b00a 100644 (file)
@@ -1542,12 +1542,12 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
     {
     case MEM_RO:
       if (writebuf != NULL)
-       return -1;
+       return TARGET_XFER_E_IO;
       break;
 
     case MEM_WO:
       if (readbuf != NULL)
-       return -1;
+       return TARGET_XFER_E_IO;
       break;
 
     case MEM_FLASH:
@@ -1557,7 +1557,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
       break;
 
     case MEM_NONE:
-      return -1;
+      return TARGET_XFER_E_IO;
     }
 
   if (!ptid_equal (inferior_ptid, null_ptid))
index 0a50606b102a9322b299add0ae93af561e9652ee..52538bc169f12274926335269d40742516b58d7c 100644 (file)
@@ -5120,7 +5120,7 @@ tfile_xfer_partial (struct target_ops *ops, enum target_object object,
 {
   /* We're only doing regular memory for now.  */
   if (object != TARGET_OBJECT_MEMORY)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   if (readbuf == NULL)
     error (_("tfile_xfer_partial: trace file is read-only"));
@@ -5199,7 +5199,7 @@ tfile_xfer_partial (struct target_ops *ops, enum target_object object,
     }
 
   /* Indicate failure to find the requested memory block.  */
-  return -1;
+  return TARGET_XFER_E_IO;
 }
 
 /* Iterate through the blocks of a trace frame, looking for a 'V'
index 5bcb7b70cd58d0c1c2ec60a8de989bd690a61c50..3ce564a047465a6c2d5edd261ec1f0d7a603a918 100644 (file)
@@ -2514,7 +2514,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
   struct so_list *so;
 
   if (writebuf)
-    return -1;
+    return TARGET_XFER_E_IO;
 
   obstack_init (&obstack);
   obstack_grow_str (&obstack, "<library-list>\n");
@@ -2557,7 +2557,7 @@ windows_xfer_partial (struct target_ops *ops, enum target_object object,
       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;
     }
 }