This is the mail archive of the
mailing list for the GDB project.
[PATCH] Fix =thread-created not showing up when detaching
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Thu, 6 Jun 2013 14:39:20 -0400
- Subject: [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 <firstname.lastname@example.org>
* 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
@@ -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);
printf_unfiltered (_("[Inferior %d detached]\n"), pid);