This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix async mode with remote targets
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 28 Nov 2009 20:07:48 +0300
- Subject: Fix async mode with remote targets
CodeSourcery has received a bug report that async mode does not work with
remote targets -- that is, if one does "continue &", GDB no longer accepts
input.
What is happening is that resume does:
/* Install inferior's terminal modes. */
target_terminal_inferior ();
...
target_resume (resume_ptid, step, sig);
Where target_terminal_inferior is:
void
target_terminal_inferior (void)
{
/* A background resume (``run&'') should leave GDB in control of the
terminal. */
if (target_is_async_p () && !sync_execution)
return;
/* If GDB is resuming the inferior in the foreground, install
inferior's terminal modes. */
(*current_target.to_terminal_inferior) ();
}
and remote_terminal_inferior has this:
delete_file_handler (input_fd);
In all-stop mode, target_is_async_p returns false until remote_resume does this:
if (target_can_async_p ())
target_async (inferior_event_handler, 0);
But this happens after target_terminal_inferior is called, and disabled stdin.
This patch fixes the problem. Approved off-list by Pedro and checked in.
There's a reasonable question why testsuite did not catch the problem. I'll get to
that shortly.
- Volodya