aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-07-13 10:28:46 +0100
committerPedro Alves <palves@redhat.com>2018-07-13 10:28:46 +0100
commitef2ddb33bd29a7c4f7027b9e37e55c74c15af825 (patch)
tree2f9d11da4ff51a4197b8537f1457c6ff22732f15 /gdb/gdbserver/server.c
parent9451a3b9a1af46cbe988c3a2cf4c4754d7e84143 (diff)
downloadgdb-ef2ddb33bd29a7c4f7027b9e37e55c74c15af825.zip
gdb-ef2ddb33bd29a7c4f7027b9e37e55c74c15af825.tar.gz
gdb-ef2ddb33bd29a7c4f7027b9e37e55c74c15af825.tar.bz2
GDBserver: Pass process_info pointer to target_detach and target_join
We start from a process_info pointer, pass down process->pid, and then the target_detach and target_join 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_detach, linux_join): Change parameter to process_info pointer instead of pid. Adjust. * lynx-low.c (lynx_detach, lynx_join): Likewise. * nto-low.c (nto_detach): Likewise. * spu-low.c (spu_detach, spu_join): Likewise. * win32-low.c (win32_detach, win32_join): Likewise. * server.c (handle_detach, detach_or_kill_for_exit): Adjust. * target.h (struct target_ops) <detach, join>: Change parameter to process_info pointer instead of pid. Adjust all implementations and callers. (detach_inferior, join_inferior): Rename 'pid' parameter to 'proc'.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index bf6302b..b35015b 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1255,7 +1255,7 @@ handle_detach (char *own_buf)
fprintf (stderr, "Detaching from process %d\n", process->pid);
stop_tracing ();
- if (detach_inferior (process->pid) != 0)
+ if (detach_inferior (process) != 0)
write_enn (own_buf);
else
{
@@ -1281,7 +1281,7 @@ handle_detach (char *own_buf)
/* If we are attached, then we can exit. Otherwise, we
need to hang around doing nothing, until the child is
gone. */
- join_inferior (process->pid);
+ join_inferior (process);
exit (0);
}
}
@@ -3526,7 +3526,7 @@ detach_or_kill_for_exit (void)
int pid = process->pid;
if (process->attached)
- detach_inferior (pid);
+ detach_inferior (process);
else
kill_inferior (pid);