Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix async mode with remote targets
@ 2009-11-28 17:07 Vladimir Prus
       [not found] ` <20091128172915.GG18125@adacore.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Prus @ 2009-11-28 17:07 UTC (permalink / raw)
  To: gdb-patches


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-28 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-28 17:07 Fix async mode with remote targets Vladimir Prus
     [not found] ` <20091128172915.GG18125@adacore.com>
2009-11-28 17:40   ` Vladimir Prus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox