-static LONGEST
-thread_db_xfer_partial (struct target_ops *ops, enum target_object object,
- const char *annex, gdb_byte *readbuf,
- const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
-{
- struct cleanup *old_chain = save_inferior_ptid ();
- LONGEST xfer;
-
- if (is_thread (inferior_ptid))
- {
- /* FIXME: This seems to be necessary to make sure breakpoints
- are removed. */
- if (!target_thread_alive (inferior_ptid))
- inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
- else
- inferior_ptid = lwp_from_thread (inferior_ptid);
- }
-
- xfer = target_beneath->to_xfer_partial (ops, object, annex,
- readbuf, writebuf, offset, len);
-
- do_cleanups (old_chain);
- return xfer;
-}
-