# HG changeset patch # Parent 34403039561e7d3e10eb37561e6b574370a182d5 Move push_target call earlier in procfs.c [PR25939] diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2781,11 +2781,6 @@ procfs_target::procfs_init_inferior (int 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 ch 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);