This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix mi-detach.exp on native-gdbserver


The =thread-exited event did not appear when detaching from a process
with "target remote".

When mourning an inferior, target remote takes a different path than
target extended_remote.  target remote calls unpush_target first which
calls remote_close in order to close the "remote" target.  remote_close
calls discard_all_inferiors, which exits all inferiors with
exit_inferior_silent.  Because it's the _silent version, we don't see
the MI event.

extended_remote_mourn calls generic_mourn_inferior, which calls
exit_inferior.  Since it's the non-silent version, we see the MI event.

When changing discard_all_inferiors to call exit_inferior instead of
exit_inferior_silent, the MI event appears.  Since remote_mourn is the
only place where discard_all_inferiors is used, it should be an otherwise
harmless change.

Regression-tested on Ubuntu 14.04, with native and native-gdbserver.

gdb/ChangeLog:

	* inferior.c (discard_all_inferiors): Call exit_inferior instead
	of exit_inferior_silent.
---
 gdb/inferior.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/inferior.c b/gdb/inferior.c
index 04e9a28..6ca18b8 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -315,7 +315,7 @@ discard_all_inferiors (void)
   for (inf = inferior_list; inf; inf = inf->next)
     {
       if (inf->pid != 0)
-	exit_inferior_silent (inf->pid);
+	exit_inferior (inf->pid);
     }
 }
 
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]