aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-08-29 18:50:25 +0000
committerDaniel Jacobowitz <drow@false.org>2002-08-29 18:50:25 +0000
commita9fa9f7daf3fdb5a1cc0149156ac8d497893cf0f (patch)
treea7aca92dbeec50d8e44abc5bc83432371681279b /gdb/gdbserver/linux-low.c
parente551c2572e97cf7ab0a431f5a1f25207d9a4d179 (diff)
downloadgdb-a9fa9f7daf3fdb5a1cc0149156ac8d497893cf0f.zip
gdb-a9fa9f7daf3fdb5a1cc0149156ac8d497893cf0f.tar.gz
gdb-a9fa9f7daf3fdb5a1cc0149156ac8d497893cf0f.tar.bz2
* linux-low.c (linux_create_inferior): Call setpgid. Return
the new PID. (unstopped_p, linux_signal_pid): Remove. (linux_target_ops): Remove linux_signal_pid. * remote-utils.c (putpkt, input_interrupt): Use signal_pid global instead of target method. * target.h (struct target_ops): Remove signal_pid. Update comment for create_inferior. * server.c (signal_pid): New variable. (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in gdbserver. Set the child to be the foreground process group. (attach_inferior): Set signal_pid.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 7048daf..7644f9e 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -149,6 +149,8 @@ linux_create_inferior (char *program, char **allargs)
signal (SIGRTMIN + 1, SIG_DFL);
+ setpgid (0, 0);
+
execv (program, allargs);
fprintf (stderr, "Cannot exec %s: %s.\n", program,
@@ -160,7 +162,7 @@ linux_create_inferior (char *program, char **allargs)
new_process = add_process (pid);
add_thread (pid, new_process);
- return 0;
+ return pid;
}
/* Attach to an inferior process. */
@@ -1228,34 +1230,6 @@ linux_look_up_symbols (void)
#endif
}
-/* Return 1 if this process is not stopped. */
-static int
-unstopped_p (struct inferior_list_entry *entry, void *dummy)
-{
- struct process_info *process = (struct process_info *) entry;
-
- if (process->stopped)
- return 0;
-
- return 1;
-}
-
-static int
-linux_signal_pid ()
-{
- struct inferior_list_entry *process;
-
- process = find_inferior (&all_processes, unstopped_p, NULL);
-
- if (process == NULL)
- {
- warning ("no unstopped process");
- return inferior_pid;
- }
-
- return pid_of ((struct process_info *) process);
-}
-
static struct target_ops linux_target_ops = {
linux_create_inferior,
@@ -1269,7 +1243,6 @@ static struct target_ops linux_target_ops = {
linux_read_memory,
linux_write_memory,
linux_look_up_symbols,
- linux_signal_pid,
};
static void