diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d03aae63ce8..1f614d5a42c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2020-06-21 Rainer Orth + + PR gdb/25939 + * procfs.c (procfs_target::procfs_init_inferior): Move push_target + call ... + (procfs_target::create_inferior): ... here. + 2020-06-21 Philippe Waroquiers * exec.c (validate_exec_file): Ensure the build-id is up to diff --git a/gdb/procfs.c b/gdb/procfs.c index 71472a5e38a..7abd6b97d06 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2781,11 +2781,6 @@ procfs_target::procfs_init_inferior (int pid) int fail; int lwpid; - /* This routine called on the parent side (GDB side) - after GDB forks the inferior. */ - if (!target_is_pushed (this)) - push_target (this); - pi = create_procinfo (pid, 0); if (pi == NULL) perror (_("procfs: out of memory in 'init_inferior'")); @@ -3006,6 +3001,9 @@ procfs_target::create_inferior (const char *exec_file, shell_file = tryname; } + if (!target_is_pushed (this)) + push_target (this); + pid = fork_inferior (exec_file, allargs, env, procfs_set_exec_trap, NULL, NULL, shell_file, NULL);