diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2016-09-11 23:45:31 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2016-09-19 00:17:29 -0400 |
commit | bc1e6c81d5b77d78282c47f6fd7f697e564a6eb6 (patch) | |
tree | 5ea22142c6941b0310eafb381d9e14d2f32a4bcf /gdb/gnu-nat.c | |
parent | 73cca75e7b187800d473ef2dc5115dd509901536 (diff) | |
download | binutils-bc1e6c81d5b77d78282c47f6fd7f697e564a6eb6.zip binutils-bc1e6c81d5b77d78282c47f6fd7f697e564a6eb6.tar.gz binutils-bc1e6c81d5b77d78282c47f6fd7f697e564a6eb6.tar.bz2 |
Consolidate target_mourn_inferior between GDB and gdbserver
This patch consolidates the API of target_mourn_inferior between GDB
and gdbserver, in my continuing efforts to make sharing the
fork_inferior function possible between both.
GDB's version of the function did not care about the inferior's ptid
being mourned, but gdbserver's needed to know this information. Since
it actually makes sense to pass the ptid as an argument, instead of
depending on a global value directly (which GDB's version did), I
decided to make the generic API to accept it. I then went on and
extended all calls being made on GDB to include a ptid argument (which
ended up being inferior_ptid most of the times, anyway), and now we
have a more sane interface.
On GDB's side, after talking to Pedro a bit about it, we decided that
just an assertion to make sure that the ptid being passed is equal to
inferior_ptid would be enough for now, on the GDB side. We can remove
the assertion and perform more operations later if we ever pass
anything different than inferior_ptid.
Regression tested on our BuildBot, everything OK.
I'd appreciate a special look at gdb/windows-nat.c's modification
because I wasn't really sure what to do there. It seemed to me that
maybe I should build a ptid out of the process information there, but
then I am almost sure the assertion on GDB's side would trigger.
gdb/ChangeLog:
2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com>
* darwin-nat.c (darwin_kill_inferior): Adjusting call to
target_mourn_inferior to include ptid_t argument.
* fork-child.c (startup_inferior): Likewise.
* gnu-nat.c (gnu_kill_inferior): Likewise.
* inf-ptrace.c (inf_ptrace_kill): Likewise.
* infrun.c (handle_inferior_event_1): Likewise.
* linux-nat.c (linux_nat_attach): Likewise.
(linux_nat_kill): Likewise.
* nto-procfs.c (interrupt_query): Likewise.
(procfs_interrupt): Likewise.
(procfs_kill_inferior): Likewise.
* procfs.c (procfs_kill_inferior): Likewise.
* record.c (record_mourn_inferior): Likewise.
* remote-sim.c (gdbsim_kill): Likewise.
* remote.c (remote_detach_1): Likewise.
(remote_kill): Likewise.
* target.c (target_mourn_inferior): Change declaration to accept
new ptid_t argument; use gdb_assert on it.
* target.h (target_mourn_inferior): Move function prototype from
here...
* target/target.h (target_mourn_inferior): ... to here. Adjust it
to accept new ptid_t argument.
* windows-nat.c (get_windows_debug_event): Adjusting call to
target_mourn_inferior to include ptid_t argument.
gdb/gdbserver/ChangeLog:
2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (start_inferior): Call target_mourn_inferior instead of
mourn_inferior; pass ptid_t argument to it.
(resume): Likewise.
(handle_target_event): Likewise.
* target.c (target_mourn_inferior): New function.
* target.h (mourn_inferior): Delete macro.
Diffstat (limited to 'gdb/gnu-nat.c')
-rw-r--r-- | gdb/gnu-nat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index c268732..927ee5c 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2074,7 +2074,7 @@ gnu_kill_inferior (struct target_ops *ops) task_terminate (task->port); inf_set_pid (gnu_current_inf, -1); } - target_mourn_inferior (); + target_mourn_inferior (inferior_ptid); } /* Clean up after the inferior dies. */ |