GDBserver: Pass process_info pointer to target_kill

We start from a process_info pointer, pass down process->pid, and
then the target_kill implementations need to find the process from the
pid again.  Pass the process_info pointer down directly instead.

gdb/gdbserver/ChangeLog:
2018-07-13  Pedro Alves  <palves@redhat.com>

	* linux-low.c (linux_kill): Change parameter to process_info
	pointer instead of pid.  Adjust.
	* lynx-low.c (lynx_kill): Likewise.
	* nto-low.c (nto_kill): Likewise.
	* spu-low.c (spu_kill): Likewise.
	* win32-low.c (win32_kill): Likewise.
	* server.c (handle_v_kill, kill_inferior_callback)
	(detach_or_kill_for_exit): Adjust.
	* target.c (kill_inferior): Change parameter to process_info
	pointer instead of pid.  Adjust.
	* target.h (struct target_ops) <kill>: Change parameter to
	process_info pointer instead of pid.  Adjust all implementations
	and callers.
	(kill_inferior): Likewise.
This commit is contained in:
Pedro Alves
2018-07-13 10:28:47 +01:00
parent ef2ddb33bd
commit a780ef4f27
9 changed files with 43 additions and 40 deletions

View File

@@ -332,11 +332,11 @@ target_pid_to_str (ptid_t ptid)
}
int
kill_inferior (int pid)
kill_inferior (process_info *proc)
{
gdb_agent_about_to_close (pid);
gdb_agent_about_to_close (proc->pid);
return (*the_target->kill) (pid);
return (*the_target->kill) (proc);
}
/* Target can do hardware single step. */