This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
missing prompt / CLI, if target refuses to resume from a fork, in async mode
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 20 May 2011 17:48:53 +0100
- Subject: missing prompt / CLI, if target refuses to resume from a fork, in async mode
fork-thread-pending.exp fails similarly to the
stepping into inline functions case, in async mode, due
to a missing prompt, and forgetting to enable stdin.
Diff gdb.log.sync vs gdb.log.async shows:
[New process XXXXX]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
warning: Not resuming: switched threads before following fork child.
[Switching to Thread 0x2aaaac8fe700 (LWP XXXXX)]
[Switching to Thread 0x2aaaac8fe700 (LWP XXXXX)]
0x00002aaaab2192f6 in fork () from /lib/libc.so.6
-(gdb) PASS: gdb.threads/fork-thread-pending.exp: 1, refused to resume
+FAIL: gdb.threads/fork-thread-pending.exp: 1, refused to resume (timeout)
Tested on x86_64-linux, sync and async, and applied.
Pedro Alves
2011-05-20 Pedro Alves <pedro@codesourcery.com>
gdb/
* infrun.c (proceed): Switch the inferior event loop to
INF_EXEC_COMPLETE if the target refused to resume from a
vfork/fork.
---
gdb/infrun.c | 2 ++
1 file changed, 2 insertions(+)
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2011-05-20 17:23:51.000000000 +0100
+++ src/gdb/infrun.c 2011-05-20 17:39:38.178819003 +0100
@@ -2066,6 +2066,8 @@ proceed (CORE_ADDR addr, enum target_sig
{
/* The target for some reason decided not to resume. */
normal_stop ();
+ if (target_can_async_p ())
+ inferior_event_handler (INF_EXEC_COMPLETE, NULL);
return;
}