From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18268 invoked by alias); 14 Dec 2012 01:57:33 -0000 Received: (qmail 18255 invoked by uid 22791); 14 Dec 2012 01:57:32 -0000 X-SWARE-Spam-Status: No, hits=-4.6 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; Fri, 14 Dec 2012 01:57:28 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TjKWl-0005qc-Lt from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 13 Dec 2012 17:57:27 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 13 Dec 2012 17:57:27 -0800 Received: from qiyao.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; Thu, 13 Dec 2012 17:57:26 -0800 Message-ID: <50CA8760.20703@codesourcery.com> Date: Fri, 14 Dec 2012 01:57:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Subject: [ping]: [PATCH] Attach discard_pending_stop_replies to observer inferior_exit References: <1354848657-10348-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1354848657-10348-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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/msg00479.txt.bz2 On 12/07/2012 10:50 AM, Yao Qi wrote: > Hi, > discard_pending_stop_replies is called in three places, remote_detach_1, > extended_remote_mourn_1 (/w param pid) and remote_close (/w param -1). > They will finally call observer_notify_inferior_exit in some way, > > remote_detach_1 >remote_mourn_1 >generic_mourn_inferior >exit_inferior >observer_notify_inferior_exit > extended_remote_mourn_1 >generic_mourn_inferior >exit_inferior >observer_notify_inferior_exit > remote_close >discard_all_inferiors >exit_inferior_silent >observer_notify_inferior_exit > > so this inspires me that we can attach discard_pending_stop_replies > to inferior_exit observer, and don't have to worry about the case that > PID is -1. This is what this patch does. Regression tested on > x86_64-linux with native and gdbserver. Is it OK? > > gdb: > > 2012-12-07 Yao Qi > > * remote.c (discard_pending_stop_replies): Remove declaration. > (remote_close): Remove call discard_pending_stop_replies. > (remote_detach_1, extended_remote_mourn_1): Likewise. > (discard_pending_stop_replies): Change parameter from PID to > INF. > (_initialize_remote): Attach discard_pending_stop_replies to > inferior_exit observer. Ping. http://sourceware.org/ml/gdb-patches/2012-12/msg00126.html This patch is kind of a cleanup/preparatory patch for 'async remote notification' patch series. This patch uses 'inferior_exit' observer to discard pending stop replies, which is better than the current approach (call discard_pending_stop_replies in different places). -- Yao (齐尧)