Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 1/2] gdbserver:Set linux target in async mode in default
Date: Tue, 18 Sep 2012 09:49:00 -0000	[thread overview]
Message-ID: <1347961672-18495-2-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1347961672-18495-1-git-send-email-yao@codesourcery.com>

Set gdbserver linux in async mode in default.

gdb/gdbserver:

2012-09-18  Yao Qi  <yao@codesourcery.com>

	* linux-low.c (target_is_async_p): Remove macro.
	(linux_wait) Don't check target_is_async_p.  Check 'non_stop'.
	(sigchld_handler): Don't check target_is_async_p, check
	non_stop instead.
	(linux_async): Don't call linux_async.
	(initialize_low): Call linux_async.
	* remote-utils.c (handle_accept_event): Don't call
	target_async, setting 'non_stop' to zero instead.
---
 gdb/gdbserver/linux-low.c    |   15 +++++----------
 gdb/gdbserver/remote-utils.c |    2 +-
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index a476031..faed578 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -264,9 +264,6 @@ static int num_regsets;
    event loop.  */
 static int linux_event_pipe[2] = { -1, -1 };
 
-/* True if we're currently in async mode.  */
-#define target_is_async_p() (linux_event_pipe[0] != -1)
-
 static void send_sigstop (struct lwp_info *lwp);
 static void wait_for_sigstop (struct inferior_list_entry *entry);
 
@@ -2797,15 +2794,13 @@ linux_wait (ptid_t ptid,
     fprintf (stderr, "linux_wait: [%s]\n", target_pid_to_str (ptid));
 
   /* Flush the async file first.  */
-  if (target_is_async_p ())
-    async_file_flush ();
+  async_file_flush ();
 
   event_ptid = linux_wait_1 (ptid, ourstatus, target_options);
 
   /* If at least one stop was reported, there may be more.  A single
      SIGCHLD can signal more than one child stop.  */
-  if (target_is_async_p ()
-      && (target_options & TARGET_WNOHANG) != 0
+  if (non_stop && (target_options & TARGET_WNOHANG) != 0
       && !ptid_equal (event_ptid, null_ptid))
     async_file_mark ();
 
@@ -4962,7 +4957,7 @@ sigchld_handler (int signo)
 	} while (0);
     }
 
-  if (target_is_async_p ())
+  if (non_stop)
     async_file_mark (); /* trigger a linux_wait */
 
   errno = old_errno;
@@ -5025,8 +5020,6 @@ linux_async (int enable)
 static int
 linux_start_non_stop (int nonstop)
 {
-  /* Register or unregister from event-loop accordingly.  */
-  linux_async (nonstop);
   return 0;
 }
 
@@ -5889,4 +5882,6 @@ initialize_low (void)
   sigemptyset (&sigchld_action.sa_mask);
   sigchld_action.sa_flags = SA_RESTART;
   sigaction (SIGCHLD, &sigchld_action, NULL);
+
+  linux_async (1);
 }
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 0b3adac..8a01da7 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -211,7 +211,7 @@ handle_accept_event (int err, gdb_client_data client_data)
      try to send vStopped notifications to GDB.  But, don't do that
      until GDB as selected all-stop/non-stop, and has queried the
      threads' status ('?').  */
-  target_async (0);
+  non_stop = 0;
 
   return 0;
 }
-- 
1.7.7.6


  parent reply	other threads:[~2012-09-18  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  9:49 [RFC 0/2, gdbserver] Set " Yao Qi
2012-09-18  9:49 ` [PATCH 2/2] gdbserver:Remove async from target_ops Yao Qi
2012-09-18  9:49 ` Yao Qi [this message]
2012-09-18 14:12 ` [RFC 0/2, gdbserver] Set linux target in async mode in default Marc Khouzam
2012-09-18 14:36   ` Yao Qi
2012-09-18 14:39     ` Marc Khouzam
2012-09-25 16:23 ` Pedro Alves
2012-09-27  3:16   ` Yao Qi
2012-10-12 12:00   ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347961672-18495-2-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox