From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19833 invoked by alias); 18 Sep 2012 09:49:19 -0000 Received: (qmail 19813 invoked by uid 22791); 18 Sep 2012 09:49:16 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Sep 2012 09:48:55 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TDuQI-0005Xx-Lg from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 18 Sep 2012 02:48:54 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 18 Sep 2012 02:48:54 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Tue, 18 Sep 2012 02:48:53 -0700 From: Yao Qi To: Subject: [PATCH 1/2] gdbserver:Set linux target in async mode in default Date: Tue, 18 Sep 2012 09:49:00 -0000 Message-ID: <1347961672-18495-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1347961672-18495-1-git-send-email-yao@codesourcery.com> References: <1347961672-18495-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00351.txt.bz2 Set gdbserver linux in async mode in default. gdb/gdbserver: 2012-09-18 Yao Qi * 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