From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15962 invoked by alias); 11 Dec 2012 06:41:06 -0000 Received: (qmail 15779 invoked by uid 22791); 11 Dec 2012 06:41:03 -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, 11 Dec 2012 06:40:58 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TiJWT-0002EW-Rj from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 10 Dec 2012 22:40:57 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 10 Dec 2012 22:40:57 -0800 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Mon, 10 Dec 2012 22:40:55 -0800 From: Yao Qi To: Subject: [PATCH 6/8] Handle notification for all-stop. Date: Tue, 11 Dec 2012 06:41:00 -0000 Message-ID: <1355208017-9204-7-git-send-email-yao@codesourcery.com> In-Reply-To: <1355208017-9204-1-git-send-email-yao@codesourcery.com> References: <1355208017-9204-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-12/txt/msg00300.txt.bz2 Now, it is possible to get notifications in all-stop mode, so we should use 'getpkt_or_notif_sane' instead of 'getpkt_sane'. Beside this, once a notification arrives, GDB will return to core as this event is not interesting and keep waiting back again. gdb: 2012-12-11 Yao Qi * remote.c (remote_wait_as): Call 'getpkt_or_notif_sane' instead of 'getpkt_sane'. Return minus_one_ptid early if gets a notification. --- gdb/remote.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index f3ab5ce..5c8b20e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5768,6 +5768,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) else { int ret; + int is_notif; if (!target_is_async_p ()) { @@ -5785,7 +5786,15 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) _never_ wait for ever -> test on target_is_async_p(). However, before we do that we need to ensure that the caller knows how to take the target into/out of async mode. */ - ret = getpkt_sane (&rs->buf, &rs->buf_size, wait_forever_enabled_p); + ret = getpkt_or_notif_sane (&rs->buf, &rs->buf_size, + wait_forever_enabled_p, &is_notif); + + if (ret != -1 && is_notif) + { + /* The target didn't really stop; keep waiting. */ + rs->waiting_for_stop_reply = 1; + return minus_one_ptid; + } if (!target_is_async_p ()) signal (SIGINT, ofunc); } -- 1.7.7.6