aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/procfs.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7298617..982f23a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * procfs.c (procfs_pre_trace): New function.
+ (procfs_target::create_inferior): Pass it to fork_inferior.
+
+2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
* configure.tgt <sparc-*-linux*> (gdb_target_obs): Remove
sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o.
<sparc64-*-linux*> (gdb_target_obs): Remove sparc64-sol2-tdep.o,
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 65243b1..d3085a2 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2759,6 +2759,13 @@ procfs_set_exec_trap (void)
/*destroy_procinfo (pi);*/
}
+/* Dummy function to be sure fork_inferior uses fork(2) and not vfork(2).
+ This avoids a possible deadlock gdb and its vfork'ed child. */
+static void
+procfs_pre_trace (void)
+{
+}
+
/* This function is called BEFORE gdb forks the inferior process. Its
only real responsibility is to set things up for the fork, and tell
GDB which two functions to call after the fork (one for the parent,
@@ -2851,7 +2858,7 @@ procfs_target::create_inferior (const char *exec_file,
push_target (this);
pid = fork_inferior (exec_file, allargs, env, procfs_set_exec_trap,
- NULL, NULL, shell_file, NULL);
+ NULL, procfs_pre_trace, shell_file, NULL);
/* We have something that executes now. We'll be running through
the shell at this point (if startup-with-shell is true), but the