aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-05-22 18:22:09 +0100
committerPedro Alves <palves@redhat.com>2018-05-22 18:33:44 +0100
commit9607784ac00f9278094e962963f6271472b1dfca (patch)
treedc36f4528326e67a5b7cee26e314b748605a7b39 /gdb
parent0e9a6b2f040e016c9dd7f9841a0272e488ed2fd5 (diff)
downloadgdb-9607784ac00f9278094e962963f6271472b1dfca.zip
gdb-9607784ac00f9278094e962963f6271472b1dfca.tar.gz
gdb-9607784ac00f9278094e962963f6271472b1dfca.tar.bz2
remote: Move discard_pending_stop_replies call
This helps because discard_pending_stop_replies will later become a method of remote_target. Otherwise, when we have multiple instances of remote_target, we'd have to make discard_pending_stop_replies find the inferior's target_ops, and upcast it to remote_target (if indeed a remote) to find the pending stop replies queue to clear. gdb/ChangeLog: 2018-05-22 Pedro Alves <palves@redhat.com> * remote.c (remote_target::mourn_inferior): Move discard_pending_stop_replies call here from ... (_initialize_remote): ... here.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/remote.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 205dd4d..55afb54 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-22 Pedro Alves <palves@redhat.com>
+ * remote.c (remote_target::mourn_inferior): Move
+ discard_pending_stop_replies call here from ...
+ (_initialize_remote): ... here.
+
+2018-05-22 Pedro Alves <palves@redhat.com>
+
* remote.c (compare_section_command): Remove set_general_process
call.
diff --git a/gdb/remote.c b/gdb/remote.c
index fbf23b8..59880a9 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9671,6 +9671,10 @@ remote_target::mourn_inferior ()
{
struct remote_state *rs = get_remote_state ();
+ /* We're no longer interested in notification events of an inferior
+ that exited or was killed/detached. */
+ discard_pending_stop_replies (current_inferior ());
+
/* In 'target remote' mode with one inferior, we close the connection. */
if (!rs->extended && number_of_live_inferiors () <= 1)
{
@@ -14073,9 +14077,6 @@ _initialize_remote (void)
/* Hook into new objfile notification. */
gdb::observers::new_objfile.attach (remote_new_objfile);
- /* We're no longer interested in notification events of an inferior
- when it exits. */
- gdb::observers::inferior_exit.attach (discard_pending_stop_replies);
#if 0
init_remote_threadtests ();