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]

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

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:

        target_terminal_inferior (void)
          /* A background resume (``run&'') should leave GDB in control of the
             terminal.  */
          if (target_is_async_p () && !sync_execution)

          /* 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

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