2004-01-28 Roland McGrath <roland@redhat.com>

* sol-thread.c (sol_thread_xfer_partial): New function.
	(init_sol_thread_ops): Use that for to_xfer_partial hook.
	(init_sol_core_ops): Likewise.
This commit is contained in:
Roland McGrath
2004-02-01 22:35:28 +00:00
parent 14ed0a8b1b
commit 6034ae49ff

View File

@ -750,6 +750,37 @@ sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
return retval; return retval;
} }
/* Perform partial transfers on OBJECT. See target_read_partial
and target_write_partial for details of each variant. One, and
only one, of readbuf or writebuf must be non-NULL. */
static LONGEST
sol_thread_xfer_partial (struct target_ops *ops, enum target_object object,
const char *annex, void *readbuf,
const void *writebuf, ULONGEST offset, LONGEST len)
{
int retval;
struct cleanup *old_chain;
old_chain = save_inferior_ptid ();
if (is_thread (inferior_ptid) || /* A thread */
!target_thread_alive (inferior_ptid)) /* An lwp, but not alive */
inferior_ptid = procfs_first_available (); /* Find any live lwp. */
/* Note: don't need to call switch_to_thread; we're just reading memory. */
if (target_has_execution)
retval = procfs_ops.to_xfer_partial (ops, object, annex,
readbuf, writebuf, offset, len);
else
retval = orig_core_ops.to_xfer_partial (ops, object, annex,
readbuf, writebuf, offset, len);
do_cleanups (old_chain);
return retval;
}
/* Print status information about what we're accessing. */ /* Print status information about what we're accessing. */
static void static void
@ -1549,6 +1580,7 @@ init_sol_thread_ops (void)
sol_thread_ops.to_store_registers = sol_thread_store_registers; sol_thread_ops.to_store_registers = sol_thread_store_registers;
sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store; sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store;
sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory; sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory;
sol_thread_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_thread_ops.to_files_info = sol_thread_files_info; sol_thread_ops.to_files_info = sol_thread_files_info;
sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint; sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
sol_thread_ops.to_remove_breakpoint = memory_remove_breakpoint; sol_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
@ -1592,6 +1624,7 @@ init_sol_core_ops (void)
sol_core_ops.to_detach = sol_core_detach; sol_core_ops.to_detach = sol_core_detach;
sol_core_ops.to_fetch_registers = sol_thread_fetch_registers; sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
sol_core_ops.to_xfer_memory = sol_thread_xfer_memory; sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
sol_core_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_core_ops.to_files_info = sol_core_files_info; sol_core_ops.to_files_info = sol_core_files_info;
sol_core_ops.to_insert_breakpoint = ignore; sol_core_ops.to_insert_breakpoint = ignore;
sol_core_ops.to_remove_breakpoint = ignore; sol_core_ops.to_remove_breakpoint = ignore;