From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1468 invoked by alias); 24 Jan 2014 09:43:18 -0000 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 Received: (qmail 1425 invoked by uid 89); 24 Jan 2014 09:43:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Jan 2014 09:43:16 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W6dI9-0005vE-5g from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 24 Jan 2014 01:43:13 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 24 Jan 2014 01:43:13 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Fri, 24 Jan 2014 01:43:12 -0800 From: Yao Qi To: Subject: [PATCH 1/5] Process notifications when reply is got Date: Fri, 24 Jan 2014 09:43:00 -0000 Message-ID: <1390556465-28796-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1390556465-28796-1-git-send-email-yao@codesourcery.com> References: <1390556465-28796-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00924.txt.bz2 GDB needs some points to consume notification events in all-stop mode. The end of remote_get_noisy_reply is good place, because GDB has got a reply from stub, and isn't expecting any others. At this moment, GDB is safe to ack notification events one by one. Likewise, it is a good time ack notification event after GDB receives a stop reply. With this change, GDB is able to get Trace notification when command tstart or tstop is executed. gdb: 2014-01-24 Yao Qi * remote.c (get_remote_state): Declare. (remote_get_noisy_reply): Call remote_notif_process if non_stop is false. (remote_wait_as): Likewise. --- gdb/remote.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 1c914ba..7110e0a 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -233,6 +233,8 @@ static int remote_supports_cond_breakpoints (void); static int remote_can_run_breakpoint_commands (void); +static struct remote_state *get_remote_state (void); + /* For "remote". */ static struct cmd_list_element *remote_cmdlist; @@ -600,7 +602,17 @@ remote_get_noisy_reply (char **buf_p, else if (buf[0] == 'O' && buf[1] != 'K') remote_console_output (buf + 1); /* 'O' message from stub */ else - return buf; /* Here's the actual reply. */ + { + struct remote_state *rs = get_remote_state (); + + /* GDB has got the reply from the remote stub. It is safe + to query notification events, because GDB isn't expecting + any reply at this moment. */ + if (!non_stop) + remote_notif_process (rs->notif_state, ¬if_client_stop); + + return buf; /* Here's the actual reply. */ + } } while (1); } @@ -6111,6 +6123,12 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) rs->buf); event_ptid = process_stop_reply (stop_reply, status); + + /* GDB has got the reply from the remote stub. It is safe + to query notification events, because GDB isn't expecting + any reply at this moment. */ + if (!non_stop) + remote_notif_process (rs->notif_state, ¬if_client_stop); break; } case 'O': /* Console output. */ -- 1.7.7.6