This is the mail archive of the 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 =thread-created not showing up when detaching


This patch refers to this bug, reported a few days ago:

Since the behavior was different between native and remote debugging, I wasn't sure which was right. After 2-3 seconds of reflexion, I believe that the =thread-exited event is relevant in this case. IIUC, we must think of thread-created as "GDB learns about a thread", whether is has really just been created or not (in case of attach), and thread-exited as "GDB forgets about a thread", whether it has really exited or not (in case of detach).

With this patch, =thread-exited now appears when detaching. I didn't see any side effects (but your more trained eye might). There is no change in existing tests results. I would be happy to add a test for this, but I am unsure where it belongs, any suggestions are appreciated!



2013-06-06  Simon Marchi  <>

	PR gdb/15564
	* inferior.c (detach_inferior): Call exit_inferior_1 with silent
	flag = 0.

diff --git a/gdb/inferior.c b/gdb/inferior.c
index b9e9a8d..bdbe59e 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -313,7 +313,7 @@ detach_inferior (int pid)
   struct inferior *inf = find_inferior_pid (pid);

-  exit_inferior_1 (inf, 1);
+  exit_inferior_1 (inf, 0);

   if (print_inferior_events)
     printf_unfiltered (_("[Inferior %d detached]\n"), pid);

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