From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32577 invoked by alias); 18 Mar 2013 01:52:17 -0000 Received: (qmail 32369 invoked by uid 22791); 18 Mar 2013 01:52:15 -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; Mon, 18 Mar 2013 01:52:02 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UHPF3-0006aR-0l from Yao_Qi@mentor.com ; Sun, 17 Mar 2013 18:52:01 -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); Sun, 17 Mar 2013 18:52:00 -0700 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; Sun, 17 Mar 2013 18:51:59 -0700 Message-ID: <51467302.6010600@codesourcery.com> Date: Mon, 18 Mar 2013 02:09:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jan Kratochvil CC: , "Metzger, Markus T" Subject: Re: [patch] Fix remote.c incorrectly using pop_target (wrt btrace) References: <20130311172836.GA22575@host2.jankratochvil.net> <513EFD81.6050401@codesourcery.com> <20130315195451.GB19841@host2.jankratochvil.net> In-Reply-To: <20130315195451.GB19841@host2.jankratochvil.net> 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: 2013-03/txt/msg00705.txt.bz2 On 03/16/2013 03:54 AM, Jan Kratochvil wrote: >> Since it is in remote_open_1, the remote target or exteneded-remote >> >target is just pushed and top most, so pop_target should be fine >> >here. It is not necessary to change it to remote_unpush_target. > OK; but one should remove pop_target later, there remain only few uses of it. > When its use is not incorrect it is at least fragile/dangerous. > Jan, I can imagine that using pop_target is fragile in general, but is it fragile/dangerous to use pop_target in remote_open_1? IMO, pop_target naturally fits the needs there (push target on stack -> setting up -> pop target out of stack on error). pop_target is also used in tracepoint.c:tfile_open, which is similar to this case. The rest of this patch looks right to me. -- Yao (齐尧)