diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-05-30 18:44:17 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-05-30 18:44:17 +0000 |
commit | 078f2fc9c153e6efd1c88b0a34eccc1164f9ae2f (patch) | |
tree | 2b7bf7f6e0a59935042475c81dbb7d1640b7ba4e | |
parent | 53dff92cb56fb21dc81c183aa35a5a3ae8c06e32 (diff) | |
download | gdb-078f2fc9c153e6efd1c88b0a34eccc1164f9ae2f.zip gdb-078f2fc9c153e6efd1c88b0a34eccc1164f9ae2f.tar.gz gdb-078f2fc9c153e6efd1c88b0a34eccc1164f9ae2f.tar.bz2 |
hurd: fix pushing target on inferior creation
This fixes creating inferiors, which was broken since 5b6d1e4fa
('Multi-target support')
gdb/ChangeLog:
* gnu-nat.c (gnu_nat_target::create_inferior): Move push_target call
before fork_inferior call. Avoid calling it if target_is_pushed returns
true.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gnu-nat.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67faed1..12321b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2020-05-30 Samuel Thibault <samuel.thibault@ens-lyon.org> + * gnu-nat.c (gnu_nat_target::create_inferior): Move push_target call + before fork_inferior call. Avoid calling it if target_is_pushed returns + true. + +2020-05-30 Samuel Thibault <samuel.thibault@ens-lyon.org> + * gnu-nat.h (gnu_target): New variable declaration. * i386-gnu-nat.c (_initialize_i386gnu_nat): Initialize gnu_target. diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 78e9ab7..90732f8 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2146,6 +2146,9 @@ gnu_nat_target::create_inferior (const char *exec_file, inf_debug (inf, "creating inferior"); + if (!target_is_pushed (this)) + push_target (this); + pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me, NULL, NULL, NULL, NULL); @@ -2159,8 +2162,6 @@ gnu_nat_target::create_inferior (const char *exec_file, inf_attach (inf, pid); - push_target (this); - inf->pending_execs = 1; inf->nomsg = 1; inf->traced = 1; |